Class: CooklangRb::Cookware
Constant Summary
Constants included from TagParser
TagParser::COOKWARE_TAG, TagParser::INGREDIENT_TAG, TagParser::MULTI_NAME, TagParser::NAME, TagParser::QUANTITY, TagParser::TIMER_TAG, TagParser::UNITS
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#quantity ⇒ Object
readonly
Returns the value of attribute quantity.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name:, quantity: 1) ⇒ Cookware
constructor
A new instance of Cookware.
Methods inherited from Tag
Methods included from QuantityResolver
Methods included from Steppable
Methods included from TagParser
Constructor Details
#initialize(name:, quantity: 1) ⇒ Cookware
Returns a new instance of Cookware.
11 12 13 14 |
# File 'lib/cooklang_rb/cookware.rb', line 11 def initialize(name:, quantity: 1) @name = clean_name(name) @quantity = resolve_quantity(quantity, default: 1) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/cooklang_rb/cookware.rb', line 5 def name @name end |
#quantity ⇒ Object (readonly)
Returns the value of attribute quantity.
5 6 7 |
# File 'lib/cooklang_rb/cookware.rb', line 5 def quantity @quantity end |
Class Method Details
.tag ⇒ Object
7 8 9 |
# File 'lib/cooklang_rb/cookware.rb', line 7 def self.tag COOKWARE_TAG end |