Class: Spritpreisrechner::Price
- Inherits:
-
Object
- Object
- Spritpreisrechner::Price
- Defined in:
- lib/spritpreisrechner/price.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#fuel_type ⇒ Object
readonly
Returns the value of attribute fuel_type.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
Instance Method Summary collapse
-
#initialize(price) ⇒ Price
constructor
A new instance of Price.
Constructor Details
#initialize(price) ⇒ Price
Returns a new instance of Price.
5 6 7 8 9 |
# File 'lib/spritpreisrechner/price.rb', line 5 def initialize(price) @fuel_type = price[:fuelType] @amount = price[:amount] @label = price[:label] end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
3 4 5 |
# File 'lib/spritpreisrechner/price.rb', line 3 def amount @amount end |
#fuel_type ⇒ Object (readonly)
Returns the value of attribute fuel_type.
3 4 5 |
# File 'lib/spritpreisrechner/price.rb', line 3 def fuel_type @fuel_type end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
3 4 5 |
# File 'lib/spritpreisrechner/price.rb', line 3 def label @label end |