Class: ApiResource::Associations::MultiObjectProxy

Inherits:
AssociationProxy show all
Includes:
Enumerable
Defined in:
lib/api_resource/associations.rb

Instance Attribute Summary

Attributes inherited from AssociationProxy

#klass, #loaded, #remote_path, #scopes, #times_loaded

Instance Method Summary collapse

Methods inherited from AssociationProxy

#initialize, #inspect, #method_missing, #reload, #scope?, #to_s

Constructor Details

This class inherits a constructor from ApiResource::Associations::AssociationProxy

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ApiResource::Associations::AssociationProxy

Instance Method Details

#allObject



415
416
417
# File 'lib/api_resource/associations.rb', line 415

def all
  self.internal_object
end

#each(*args, &block) ⇒ Object



419
420
421
# File 'lib/api_resource/associations.rb', line 419

def each(*args, &block)
  self.internal_object.each(*args, &block)
end

#internal_objectObject

force a load when calling this method



428
429
430
# File 'lib/api_resource/associations.rb', line 428

def internal_object
  @internal_object ||= self.load_scope_with_options(:all, {})
end

#serializable_hash(options) ⇒ Object



423
424
425
# File 'lib/api_resource/associations.rb', line 423

def serializable_hash(options)
  self.internal_object.collect{|obj| obj.serializable_hash(options) }
end