Class: Expo::Proxy

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

Instance Method Summary collapse

Constructor Details

#initialize(*objects) ⇒ Proxy

Returns a new instance of Proxy.



158
159
160
# File 'lib/expo.rb', line 158

def initialize(*objects)
  @objects = objects
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



162
163
164
165
166
# File 'lib/expo.rb', line 162

def method_missing(method, *args, &block)
  @objects.detect{|obj| obj.respond_to? method}.send(
    method, *args, &block
  )
end