Class: FDDB::Items

Inherits:
Object
  • Object
show all
Includes:
Parser
Defined in:
lib/fddb/items.rb

Instance Method Summary collapse

Methods included from Parser

#parse

Constructor Details

#initialize(xml_data) ⇒ Items

Returns a new instance of Items.



6
7
8
# File 'lib/fddb/items.rb', line 6

def initialize (xml_data)
  create_items((parse xml_data)['result']['item'])
end

Instance Method Details

#get_ingredients(query = nil) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/fddb/items.rb', line 10

def get_ingredients (query = nil)
  result = []
  @items.each do |item|
    result << (item.get_ingredients query)
  end
  result
end