Class: Yummly::Unit
- Inherits:
-
Object
- Object
- Yummly::Unit
- Defined in:
- lib/yummly/unit.rb
Overview
The implied unit of measure for a nutrition estimate.
Instance Attribute Summary collapse
-
#abbreviation ⇒ Object
Single unit abbreviation for unit of measure.
-
#name ⇒ Object
Single unit display name for unit of measure.
-
#plural ⇒ Object
Plural display name for unit of measure.
-
#plural_abbreviation ⇒ Object
Plural unit abbreviation for unit of measure.
Instance Method Summary collapse
-
#initialize(values) ⇒ Unit
constructor
A new instance of Unit.
Constructor Details
#initialize(values) ⇒ Unit
Returns a new instance of Unit.
16 17 18 19 20 21 |
# File 'lib/yummly/unit.rb', line 16 def initialize(values) @name = values["name"] @abbreviation = values["abbreviation"] @plural = values["plural"] @plural_abbreviation = values["pluralAbbreviation"] end |
Instance Attribute Details
#abbreviation ⇒ Object
Single unit abbreviation for unit of measure.
8 9 10 |
# File 'lib/yummly/unit.rb', line 8 def abbreviation @abbreviation end |
#name ⇒ Object
Single unit display name for unit of measure.
5 6 7 |
# File 'lib/yummly/unit.rb', line 5 def name @name end |
#plural ⇒ Object
Plural display name for unit of measure.
11 12 13 |
# File 'lib/yummly/unit.rb', line 11 def plural @plural end |
#plural_abbreviation ⇒ Object
Plural unit abbreviation for unit of measure.
14 15 16 |
# File 'lib/yummly/unit.rb', line 14 def plural_abbreviation @plural_abbreviation end |