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

Version Path
arstotzka-1.4.2 spec/support/models/drink.rb
arstotzka-1.4.1 spec/support/models/drink.rb
arstotzka-1.4.0 spec/support/models/drink.rb
arstotzka-1.3.2 spec/support/models/drink.rb
arstotzka-1.3.1 spec/support/models/drink.rb
arstotzka-1.3.0 spec/support/models/drink.rb
arstotzka-1.2.4 spec/support/models/drink.rb
arstotzka-1.2.3 spec/support/models/drink.rb
arstotzka-1.2.2 spec/support/models/drink.rb
arstotzka-1.2.1 spec/support/models/drink.rb