Class: EyeOfNewt::Ingredient

Inherits:
Object
  • Object
show all
Defined in:
lib/eye_of_newt/ingredient.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#amountObject

Returns the value of attribute amount.



3
4
5
# File 'lib/eye_of_newt/ingredient.rb', line 3

def amount
  @amount
end

#namesObject

Returns the value of attribute names.



3
4
5
# File 'lib/eye_of_newt/ingredient.rb', line 3

def names
  @names
end

#noteObject

Returns the value of attribute note.



3
4
5
# File 'lib/eye_of_newt/ingredient.rb', line 3

def note
  @note
end

#styleObject

Returns the value of attribute style.



3
4
5
# File 'lib/eye_of_newt/ingredient.rb', line 3

def style
  @style
end

#unitObject

Returns the value of attribute unit.



3
4
5
# File 'lib/eye_of_newt/ingredient.rb', line 3

def unit
  @unit
end

#unit_modifierObject

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

#nameObject



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