class BeerRecipe::RecipeReader
Attributes
parser[RW]
recipe[RW]
Public Class Methods
new(options = {})
click to toggle source
# File lib/beer_recipe/recipe_reader.rb, line 4 def initialize(options = {}) @options = options end
Public Instance Methods
output()
click to toggle source
# File lib/beer_recipe/recipe_reader.rb, line 18 def output @options[:formatter].format(recipe) self end
read()
click to toggle source
# File lib/beer_recipe/recipe_reader.rb, line 8 def read @parser ||= NRB::BeerXML::Parser.new @beerxml = parser.parse @options[:file] self end