class FoodIngredientParser::Strict::Grammar::RootNode

Root object, contains everything else.

Public Instance Methods

to_h() click to toggle source
# 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