Class: Jekyll::Converters::Step
- Defined in:
- lib/jekyll/converters/cooklang.rb
Instance Method Summary collapse
-
#initialize(step) ⇒ Step
constructor
A new instance of Step.
- #to_html ⇒ Object
Methods inherited from ToHTML
Constructor Details
#initialize(step) ⇒ Step
Returns a new instance of Step.
86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/jekyll/converters/cooklang.rb', line 86 def initialize(step) @text = step.map do |substep| case substep["type"] when "cookware" substep["name"] when "ingredient" substep["name"] when "timer" "#{substep["quantity"]} #{substep["units"]}" when "text" substep["value"] end end.join end |
Instance Method Details
#to_html ⇒ Object
101 102 103 |
# File 'lib/jekyll/converters/cooklang.rb', line 101 def to_html "<p>#{@text}</p>" end |