Class: Rlocu::Menu::Option
- Inherits:
-
Object
- Object
- Rlocu::Menu::Option
- Defined in:
- lib/rlocu/menu.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#price ⇒ Object
readonly
Returns the value of attribute price.
Instance Method Summary collapse
-
#initialize(option_hash) ⇒ Option
constructor
A new instance of Option.
- #to_s ⇒ Object
Constructor Details
#initialize(option_hash) ⇒ Option
Returns a new instance of Option.
133 134 135 136 137 |
# File 'lib/rlocu/menu.rb', line 133 def initialize(option_hash) @name = option_hash['name'] @price = option_hash['price'] # price can be relative indicated by a + in the price end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
132 133 134 |
# File 'lib/rlocu/menu.rb', line 132 def name @name end |
#price ⇒ Object (readonly)
Returns the value of attribute price.
132 133 134 |
# File 'lib/rlocu/menu.rb', line 132 def price @price end |
Instance Method Details
#to_s ⇒ Object
139 140 141 |
# File 'lib/rlocu/menu.rb', line 139 def to_s "#{name} #{price}" end |