Class: ItemCollection

Inherits:
Array
  • Object
show all
Defined in:
lib/wunder/collections/item_collection.rb

Instance Method Summary collapse

Instance Method Details

#find_product(product_code) ⇒ Object



2
3
4
5
6
7
8
9
# File 'lib/wunder/collections/item_collection.rb', line 2

def find_product(product_code)
  @item = nil
  each do |item|
    @item = item if item.product.product_code == product_code
  end

  @item
end