Class: EyeOfNewt::Ingredient
- Inherits:
-
Object
- Object
- EyeOfNewt::Ingredient
- Defined in:
- lib/eye_of_newt/ingredient.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#names ⇒ Object
Returns the value of attribute names.
-
#note ⇒ Object
Returns the value of attribute note.
-
#style ⇒ Object
Returns the value of attribute style.
-
#unit ⇒ Object
Returns the value of attribute unit.
-
#unit_modifier ⇒ Object
Returns the value of attribute unit_modifier.
Instance Method Summary collapse
-
#initialize(amount: nil, unit: nil, unit_modifier: nil, names: [], style: nil, note: nil) ⇒ Ingredient
constructor
A new instance of Ingredient.
- #name ⇒ Object
- #name=(n) ⇒ Object
Constructor Details
#initialize(amount: nil, unit: nil, unit_modifier: nil, names: [], style: nil, note: nil) ⇒ Ingredient
Returns a new instance of Ingredient.
5 6 7 8 9 10 11 12 |
# File 'lib/eye_of_newt/ingredient.rb', line 5 def initialize(amount: nil, unit: nil, unit_modifier: nil, names: [], style: nil, note: nil) self.amount = amount self.unit = unit self.unit_modifier = unit_modifier self.names = names self.style = style self.note = note end |
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
3 4 5 |
# File 'lib/eye_of_newt/ingredient.rb', line 3 def amount @amount end |
#names ⇒ Object
Returns the value of attribute names.
3 4 5 |
# File 'lib/eye_of_newt/ingredient.rb', line 3 def names @names end |
#note ⇒ Object
Returns the value of attribute note.
3 4 5 |
# File 'lib/eye_of_newt/ingredient.rb', line 3 def note @note end |
#style ⇒ Object
Returns the value of attribute style.
3 4 5 |
# File 'lib/eye_of_newt/ingredient.rb', line 3 def style @style end |
#unit ⇒ Object
Returns the value of attribute unit.
3 4 5 |
# File 'lib/eye_of_newt/ingredient.rb', line 3 def unit @unit end |
#unit_modifier ⇒ Object
Returns the value of attribute unit_modifier.
3 4 5 |
# File 'lib/eye_of_newt/ingredient.rb', line 3 def unit_modifier @unit_modifier end |
Instance Method Details
#name ⇒ Object
14 15 16 |
# File 'lib/eye_of_newt/ingredient.rb', line 14 def name names.first end |
#name=(n) ⇒ Object
18 19 20 |
# File 'lib/eye_of_newt/ingredient.rb', line 18 def name=(n) self.names = [n] end |