class Mg2en::Parser
Parse a MacGourmet 3 Plist export file into array of recipe objects.
Attributes
recipes[R]
Public Class Methods
new(filename_or_xml)
click to toggle source
# File lib/mg2en/parser.rb, line 8 def initialize(filename_or_xml) recipe_input = Plist.parse_xml(filename_or_xml) fail ArgumentError, 'Unable to parse input' unless recipe_input @recipes = [] recipe_input.each do |r| recipe = Mg2en::Recipe.new(r) @recipes.push recipe end end