Class: Roulette::EachStore

Inherits:
Object
  • Object
show all
Defined in:
lib/roulette/each_store.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stores) ⇒ EachStore

Returns a new instance of EachStore.



4
5
6
# File 'lib/roulette/each_store.rb', line 4

def initialize(stores)
  self.stores = stores
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args, &blk) ⇒ Object



8
9
10
11
12
# File 'lib/roulette/each_store.rb', line 8

def method_missing(method_name, *args, &blk)
  stores.collect do |store|
    store.send method_name, *args
  end
end

Instance Attribute Details

#storesObject

Returns the value of attribute stores.



2
3
4
# File 'lib/roulette/each_store.rb', line 2

def stores
  @stores
end