Sha256: be12413d7c15c7dd7ea34d5408df0fd2fcb3d933ba90d4405e731aa5483de6b2
Contents?: true
Size: 357 Bytes
Versions: 10
Compression:
Stored size: 357 Bytes
Contents
# frozen_string_literal: true class Drink attr_reader :name, :price def initialize(name:, price:) @name = name @price = price end def inflate(inflation) @price = (price * (1 + inflation)).round(2) end def ==(other) return false unless other.class == self.class other.name == name && other.price == price end end
Version data entries
10 entries across 10 versions & 1 rubygems