DIVERGENT CHANGE # priceable.rb module Priceable def price psychological_price( @cost * @margin ) end private def psychological_price ( amount ) if amount .ceil == amount ( amount + BigDecimal ( '0.50' )).ceil - BigDecimal ( '0.01' ) else ( amount ).ceil - BigDecimal ( '0.01' ) end end end
DIVERGENT CHANGE # priceable.rb Steak prices are based on cut module Priceable def price psychological_price( @cost * @margin ) end private def psychological_price ( amount ) if amount .ceil == amount ( amount + BigDecimal ( '0.50' )).ceil - BigDecimal ( '0.01' ) else ( amount ).ceil - BigDecimal ( '0.01' ) end end end
DIVERGENT CHANGE # priceable.rb module Priceable Steak prices are based on cut def price total += psychological_price( @cost * @margin ) if @type == :steak && @cut == :flatiron total + BigDecimal ( '5' ) else total end end private def psychological_price ( amount ) if amount .ceil == amount ( amount + BigDecimal ( '0.50' )).ceil - BigDecimal ( '0.01' ) else ( amount ).ceil - BigDecimal ( '0.01' ) end end end
DIVERGENT CHANGE # priceable.rb module Priceable def price total += psychological_price( @cost * @margin ) if @type == :steak && @cut == :flatiron total + BigDecimal ( '5' ) else total end end private def psychological_price ( amount ) if amount .ceil == amount ( amount + BigDecimal ( '0.50' )).ceil - BigDecimal ( '0.01' ) else ( amount ).ceil - BigDecimal ( '0.01' ) end end end
DIVERGENT CHANGE # priceable.rb Produce prices are based on season module Priceable def price total += psychological_price( @cost * @margin ) if @type == :steak && @cut == :flatiron total + BigDecimal ( '5' ) else total end end private def psychological_price ( amount ) if amount .ceil == amount ( amount + BigDecimal ( '0.50' )).ceil - BigDecimal ( '0.01' ) else ( amount ).ceil - BigDecimal ( '0.01' ) end end end
DIVERGENT CHANGE # priceable.rb Produce prices are based on season module Priceable def price ( season = nil ) total = psychological_price( @cost * @margin ) if @type == :steak && @cut == :flatiron total + BigDecimal ( '5' ) else season != @growing_season ? total + 1 : total end end private def psychological_price ( amount ) if amount .ceil == amount ( amount + BigDecimal ( '0.50' )).ceil - BigDecimal ( '0.01' ) else ( amount ).ceil - BigDecimal ( '0.01' ) end end end
DIVERGENT CHANGE # priceable.rb module Priceable def price ( season = nil ) total = psychological_price( @cost * @margin ) if @type == :steak && @cut == :flatiron total + BigDecimal ( '5' ) else season != @growing_season ? total + 1 : total end end private def psychological_price ( amount ) if amount .ceil == amount ( amount + BigDecimal ( '0.50' )).ceil - BigDecimal ( '0.01' ) else ( amount ).ceil - BigDecimal ( '0.01' ) end end end
Shotgun Divergent Surgery Change
NOTICING DIVERGENT CHANGE
TECHNIQUES
GETTING BACK TO SAFETY
class Produce include Priceable def initialize ( cost , growing_season ) @cost = cost @growing_season = growing_season @margin = BigDecimal ( '100' ) end end
class Produce include Priceable def initialize ( cost , growing_season ) @cost = cost @growing_season = growing_season @margin = BigDecimal ( '100' ) end end
class Produce include Priceable def initialize ( cost , growing_season ) @cost = cost @growing_season = growing_season @margin = BigDecimal ( '100' ) end end
class Produce def initialize ( cost , growing_season ) @cost = cost @growing_season = growing_season @margin = BigDecimal ( '100' ) end def price(season = nil) total = psychological_price(@price * @margin) if @type == :steak && @cut == :flatiron total + BigDecimal('5') else season != @growing_season ? total + 1 : total end end private def psychological_price(amount) if amount.ceil == amount (amount + BigDecimal('0.50')).ceil - BigDecimal('0.01') else (amount).ceil - BigDecimal('0.01') end end end
class Produce def initialize ( cost , growing_season ) @cost = cost @growing_season = growing_season @margin = BigDecimal ( '100' ) end def price(season = nil) total = psychological_price(@cost * @margin) if @type == :steak && @cut == :flatiron total + BigDecimal('5') else season != @growing_season ? total + 1 : total end end private def psychological_price(amount) if amount.ceil == amount (amount + BigDecimal('0.50')).ceil - BigDecimal('0.01') else (amount).ceil - BigDecimal('0.01') end end end
class Produce def initialize ( cost , growing_season ) @cost = cost @growing_season = growing_season @margin = BigDecimal ( '100' ) end def price(season = nil) total = psychological_price(@cost * @margin) if @type == :steak && @cut == :flatiron total + BigDecimal('5') else season != @growing_season ? total + 1 : total end end private def psychological_price(amount) if amount.ceil == amount (amount + BigDecimal('0.50')).ceil - BigDecimal('0.01') else (amount).ceil - BigDecimal('0.01') end end end
class Produce def initialize ( cost , growing_season ) @cost = cost @growing_season = growing_season @margin = BigDecimal ( '100' ) end def price(season = nil) total = psychological_price(@cost * @margin) if @type == :steak && @cut == :flatiron total + BigDecimal('5') else season != @growing_season ? total + 1 : total end end private def psychological_price(amount) if amount.ceil == amount (amount + BigDecimal('0.50')).ceil - BigDecimal('0.01') else (amount).ceil - BigDecimal('0.01') end end end
class Produce def initialize ( cost , growing_season ) @cost = cost @growing_season = growing_season @margin = BigDecimal ( '100' ) end def price(season = nil) total = psychological_price(@cost * @margin) if @type == :steak && @cut == :flatiron total + BigDecimal('5') else season != @growing_season ? total + 1 : total end end private def psychological_price(amount) if amount.ceil == amount (amount + BigDecimal('0.50')).ceil - BigDecimal('0.01') else (amount).ceil - BigDecimal('0.01') end end end
class Produce def initialize ( cost , growing_season ) @cost = cost @growing_season = growing_season @margin = BigDecimal ( '100' ) end def price(season = nil) total = psychological_price(@cost * @margin) season != @growing_season ? total + 1 : total end private def psychological_price(amount) if amount.ceil == amount (amount + BigDecimal('0.50')).ceil - BigDecimal('0.01') else (amount).ceil - BigDecimal('0.01') end end end
class DryGood include Priceable def initialize ( cost ) @cost = cost @margin = BigDecimal ( '200' ) end end
class DryGood include Priceable def initialize ( cost ) @cost = cost @margin = BigDecimal ( '200' ) end end
class DryGood include Priceable def initialize ( cost ) @cost = cost @margin = BigDecimal ( '200' ) end end
class DryGood def initialize ( cost ) @cost = cost @margin = BigDecimal ( '200' ) end def price ( season = nil ) total = psychological_price( @price * @margin ) if @type == :steak && @cut == :flatiron total + BigDecimal ( '5' ) else season != @growing_season ? total + 1 : total end end private def psychological_price ( amount ) if amount .ceil == amount ( amount + BigDecimal ( '0.50' )).ceil - BigDecimal ( '0.01' ) else ( amount ).ceil - BigDecimal ( '0.01' ) end end end
class DryGood def initialize ( cost ) @cost = cost @margin = BigDecimal ( '200' ) end def price ( season = nil ) total = psychological_price( @cost * @margin ) if @type == :steak && @cut == :flatiron total + BigDecimal ( '5' ) else season != @growing_season ? total + 1 : total end end private def psychological_price ( amount ) if amount .ceil == amount ( amount + BigDecimal ( '0.50' )).ceil - BigDecimal ( '0.01' ) else ( amount ).ceil - BigDecimal ( '0.01' ) end end end
class DryGood def initialize ( cost ) @cost = cost @margin = BigDecimal ( '200' ) end def price ( season = nil ) total = psychological_price( @cost * @margin ) if @type == :steak && @cut == :flatiron total + BigDecimal ( '5' ) else season != @growing_season ? total + 1 : total end end private def psychological_price ( amount ) if amount .ceil == amount ( amount + BigDecimal ( '0.50' )).ceil - BigDecimal ( '0.01' ) else ( amount ).ceil - BigDecimal ( '0.01' ) end end end
class DryGood def initialize ( cost ) @cost = cost @margin = BigDecimal ( '200' ) end def price ( season = nil ) total = psychological_price( @cost * @margin ) if @type == :steak && @cut == :flatiron total + BigDecimal ( '5' ) else season != @growing_season ? total + 1 : total end end private def psychological_price ( amount ) if amount .ceil == amount ( amount + BigDecimal ( '0.50' )).ceil - BigDecimal ( '0.01' ) else ( amount ).ceil - BigDecimal ( '0.01' ) end end end
class DryGood def initialize ( cost ) @cost = cost @margin = BigDecimal ( '200' ) end def price () total = psychological_price( @cost * @margin ) if @type == :steak && @cut == :flatiron total + BigDecimal ( '5' ) else season != @growing_season ? total + 1 : total end end private def psychological_price ( amount ) if amount .ceil == amount ( amount + BigDecimal ( '0.50' )).ceil - BigDecimal ( '0.01' ) else ( amount ).ceil - BigDecimal ( '0.01' ) end end end
class DryGood def initialize ( cost ) @cost = cost @margin = BigDecimal ( '200' ) end def price () psychological_price( @cost * @margin ) end private def psychological_price ( amount ) if amount .ceil == amount ( amount + BigDecimal ( '0.50' )).ceil - BigDecimal ( '0.01' ) else ( amount ).ceil - BigDecimal ( '0.01' ) end end end
class Meat include Priceable def initialize ( cost , type , cut ) @cost = cost @type = type @cut = cut @margin = BigDecimal ( '300' ) end end
class Meat include Priceable def initialize ( cost , type , cut ) @cost = cost @type = type @cut = cut @margin = BigDecimal ( '300' ) end end
class Meat include Priceable def initialize ( cost , type , cut ) @cost = cost @type = type @cut = cut @margin = BigDecimal ( '300' ) end end
class Meat def initialize ( cost , type , cut ) @cost = cost @type = type @cut = cut @margin = BigDecimal ( '300' ) end def price ( season = nil ) total = psychological_price( @price * @margin ) if @type == :steak && @cut == :flatiron total + BigDecimal ( '5' ) else season != @growing_season ? total + 1 : total end end private def psychological_price ( amount ) if amount .ceil == amount ( amount + BigDecimal ( '0.50' )).ceil - BigDecimal ( '0.01' ) else ( amount ).ceil - BigDecimal ( '0.01' ) end end end
class Meat def initialize ( cost , type , cut ) @cost = cost @type = type @cut = cut @margin = BigDecimal ( '300' ) end def price ( season = nil ) total = psychological_price( @cost * @margin ) if @type == :steak && @cut == :flatiron total + BigDecimal ( '5' ) else season != @growing_season ? total + 1 : total end end private def psychological_price ( amount ) if amount .ceil == amount ( amount + BigDecimal ( '0.50' )).ceil - BigDecimal ( '0.01' ) else ( amount ).ceil - BigDecimal ( '0.01' ) end end end
class Meat def initialize ( cost , type , cut ) @cost = cost @type = type @cut = cut @margin = BigDecimal ( '300' ) end def price ( season = nil ) total = psychological_price( @cost * @margin ) if @type == :steak && @cut == :flatiron total + BigDecimal ( '5' ) else season != @growing_season ? total + 1 : total end end private def psychological_price ( amount ) if amount .ceil == amount ( amount + BigDecimal ( '0.50' )).ceil - BigDecimal ( '0.01' ) else ( amount ).ceil - BigDecimal ( '0.01' ) end end end
class Meat def initialize ( cost , type , cut ) @cost = cost @type = type @cut = cut @margin = BigDecimal ( '300' ) end def price (season = nil) total = psychological_price( @cost * @margin ) if @type == :steak && @cut == :flatiron total + BigDecimal ( '5' ) else season != @growing_season ? total + 1 : total end end private def psychological_price ( amount ) if amount .ceil == amount ( amount + BigDecimal ( '0.50' )).ceil - BigDecimal ( '0.01' ) else ( amount ).ceil - BigDecimal ( '0.01' ) end end end
class Meat def initialize ( cost , type , cut ) @cost = cost @type = type @cut = cut @margin = BigDecimal ( '300' ) end def price () total = psychological_price( @cost * @margin ) if @type == :steak && @cut == :flatiron total + BigDecimal ( '5' ) else season != @growing_season ? total + 1 : total end end private def psychological_price ( amount ) if amount .ceil == amount ( amount + BigDecimal ( '0.50' )).ceil - BigDecimal ( '0.01' ) else ( amount ).ceil - BigDecimal ( '0.01' ) end end end
class Meat def initialize ( cost , type , cut ) @cost = cost @type = type @cut = cut @margin = BigDecimal ( '300' ) end def price () total = psychological_price( @cost * @margin ) if @type == :steak && @cut == :flatiron total + BigDecimal ( '5' ) else total end end private def psychological_price ( amount ) if amount .ceil == amount ( amount + BigDecimal ( '0.50' )).ceil - BigDecimal ( '0.01' ) else ( amount ).ceil - BigDecimal ( '0.01' ) end end end
module Priceable def price ( season = nil ) total = psychological_price( @cost * @margin ) if @type == :steak && @cut == :flatiron total + BigDecimal ( '5' ) else season != @growing_season ? total + 1 : total end end private def psychological_price ( amount ) if amount .ceil == amount ( amount + BigDecimal ( '0.50' )).ceil - BigDecimal ( '0.01' ) else ( amount ).ceil - BigDecimal ( '0.01' ) end end end
module Priceable def price ( season = nil ) total = psychological_price( @cost * @margin ) if @type == :steak && @cut == :flatiron total + BigDecimal ( '5' ) else season != @growing_season ? total + 1 : total end end private def psychological_price ( amount ) if amount .ceil == amount ( amount + BigDecimal ( '0.50' )).ceil - BigDecimal ( '0.01' ) else ( amount ).ceil - BigDecimal ( '0.01' ) end end end
Recommend
More recommend