Skip to content

Commit

Permalink
p.145 introduce temporary variable "base_price" step 2.
Browse files Browse the repository at this point in the history
  • Loading branch information
kono committed May 22, 2010
1 parent 548563d commit d0870bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion chapter6/Introduce_Explaining_Variable.rb
Expand Up @@ -10,7 +10,7 @@ def price
base_price = @quantity * @item_price
return base_price -
[0, @quantity - 500].max * @item_price * 0.05 +
[@quantity * @item_price * 0.1,100.0].min
[base_price * 0.1,100.0].min
end
end

0 comments on commit d0870bf

Please sign in to comment.