class Pizza

Attributes

amount[R]

Public Class Methods

new(amount) click to toggle source
# File lib/pizza.rb, line 4
def initialize(amount)
  @amount = amount
end

Public Instance Methods

larges() click to toggle source
# File lib/pizza.rb, line 13
def larges
  amt = ((amount.to_f + 1)/4)
  (amt.to_s).include?(".25") ? (amt + 1).round : amt.round
end
mediums() click to toggle source
# File lib/pizza.rb, line 8
def mediums
  amt = ((amount.to_f + 1)/3)
  (amt.to_s).include?(".33") ? (amt + 1).round : amt.round
end