Class: CooklangRb::Recipe
- Inherits:
-
Object
- Object
- CooklangRb::Recipe
- Includes:
- BufferUtils
- Defined in:
- lib/cooklang_rb/recipe.rb
Instance Attribute Summary collapse
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#steps ⇒ Object
readonly
Returns the value of attribute steps.
Class Method Summary collapse
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(source) ⇒ Recipe
constructor
A new instance of Recipe.
Methods included from BufferUtils
#end_of_buffer?, #end_of_line?
Constructor Details
#initialize(source) ⇒ Recipe
Returns a new instance of Recipe.
17 18 19 20 21 22 |
# File 'lib/cooklang_rb/recipe.rb', line 17 def initialize(source) @source = source @steps = [] @metadata = {} parse end |
Instance Attribute Details
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
11 12 13 |
# File 'lib/cooklang_rb/recipe.rb', line 11 def @metadata end |
#steps ⇒ Object (readonly)
Returns the value of attribute steps.
11 12 13 |
# File 'lib/cooklang_rb/recipe.rb', line 11 def steps @steps end |
Class Method Details
.from(source) ⇒ Object
13 14 15 |
# File 'lib/cooklang_rb/recipe.rb', line 13 def self.from(source) new(source).data end |
Instance Method Details
#data ⇒ Object
24 25 26 27 28 29 |
# File 'lib/cooklang_rb/recipe.rb', line 24 def data { "metadata" => @metadata, "steps" => @steps } end |