Class: Xero::Associations::HasManyProxy

Inherits:
BasicObject
Defined in:
lib/xero/associations/has_many_proxy.rb

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ HasManyProxy

Returns a new instance of HasManyProxy.



5
6
7
# File 'lib/xero/associations/has_many_proxy.rb', line 5

def initialize(*args)
  @target = ::Array.new(*args)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



19
20
21
# File 'lib/xero/associations/has_many_proxy.rb', line 19

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

Instance Method Details

#xero_attributesObject



9
10
11
# File 'lib/xero/associations/has_many_proxy.rb', line 9

def xero_attributes
  target.map(&:xero_attributes)
end