class Counter
attr_accessor :count
def initialize
@count = 0
end
def inc_by(value)
@count += value
end
def inc_by_amount(value, amount)
@count += value * amount
end
end
counter = Counter.new
counter.inc_by(1)
# counter.count is 1
puts "count is #{counter.count}"
counter.inc_by_amount(2, 5)
# counter.count is 11
puts "count is #{counter.count}"