Class: FoodIngredientParser::Strict::Grammar::RootNode
- Inherits:
-
SyntaxNode
- Object
- Treetop::Runtime::SyntaxNode
- SyntaxNode
- FoodIngredientParser::Strict::Grammar::RootNode
- Includes:
- ToHtml
- Defined in:
- lib/food_ingredient_parser/strict/nodes.rb
Overview
Root object, contains everything else.
Instance Method Summary collapse
Methods included from ToHtml
Instance Method Details
#to_h ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/food_ingredient_parser/strict/nodes.rb', line 25 def to_h h = { contains: contains.to_a } if notes && notes_ary = to_a_deep(notes, NoteNode)&.map(&:text_value) h[:notes] = notes_ary if notes_ary.length > 0 end h end |