Class: CooklangRb::Step

Inherits:
Object
  • Object
show all
Includes:
BufferUtils
Defined in:
lib/cooklang_rb/step.rb

Constant Summary collapse

TAG_MAP =
{
  "@" => Ingredient,
  "#" => Cookware,
  "~" => Timer
}.freeze

Instance Method Summary collapse

Methods included from BufferUtils

#end_of_buffer?, #end_of_line?

Constructor Details

#initialize(buffer) ⇒ Step

Returns a new instance of Step.



19
20
21
22
# File 'lib/cooklang_rb/step.rb', line 19

def initialize(buffer)
  @buffer = buffer
  @content = []
end

Instance Method Details

#buildObject



24
25
26
27
28
29
30
# File 'lib/cooklang_rb/step.rb', line 24

def build
  until end_of_step?
    @content << take_step
  end

  @content
end