Class: Cooklang::Formatters::Text
- Inherits:
-
Cooklang::Formatter
- Object
- Cooklang::Formatter
- Cooklang::Formatters::Text
- Defined in:
- lib/cooklang/formatters/text.rb
Instance Attribute Summary
Attributes inherited from Cooklang::Formatter
Instance Method Summary collapse
Methods inherited from Cooklang::Formatter
Constructor Details
This class inherits a constructor from Cooklang::Formatter
Instance Method Details
#generate(*args) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/cooklang/formatters/text.rb', line 6 def generate(*args) sections = [] sections << ingredients_section unless recipe.ingredients.empty? sections << steps_section unless recipe.steps.empty? sections.join("\n").strip end |