Module: Humanoid::Associations::Proxy::InstanceMethods

Defined in:
lib/humanoid/associations/proxy.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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

Default behavior of method missing should be to delegate all calls to the target of the proxy. This can be overridden in special cases.



20
21
22
# File 'lib/humanoid/associations/proxy.rb', line 20

def method_missing(name, *args, &block)
  @target.send(name, *args, &block)
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



14
15
16
# File 'lib/humanoid/associations/proxy.rb', line 14

def options
  @options
end

#targetObject (readonly)

Returns the value of attribute target.



14
15
16
# File 'lib/humanoid/associations/proxy.rb', line 14

def target
  @target
end

Instance Method Details

#extends(options) ⇒ Object

If anonymous extensions are added this will take care of them.



25
26
27
# File 'lib/humanoid/associations/proxy.rb', line 25

def extends(options)
  extend Module.new(&options.extension) if options.extension?
end