Class: Rlocu::Menu::Option

Inherits:
Object
  • Object
show all
Defined in:
lib/rlocu/menu.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (readonly)

Returns the value of attribute name.



132
133
134
# File 'lib/rlocu/menu.rb', line 132

def name
  @name
end

#priceObject (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_sObject



139
140
141
# File 'lib/rlocu/menu.rb', line 139

def to_s
  "#{name} #{price}"
end