Class: OldApiResource::Associations::ResourceScope

Inherits:
Scope
  • Object
show all
Includes:
Enumerable
Defined in:
lib/old_api_resource/associations/resource_scope.rb

Instance Attribute Summary

Attributes inherited from Scope

#current_scope, #klass, #scopes

Instance Method Summary collapse

Methods inherited from Scope

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

Constructor Details

This class inherits a constructor from OldApiResource::Associations::Scope

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class OldApiResource::Associations::Scope

Instance Method Details

#each(*args, &block) ⇒ Object



17
18
19
# File 'lib/old_api_resource/associations/resource_scope.rb', line 17

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

#internal_objectObject Also known as: all



11
12
13
# File 'lib/old_api_resource/associations/resource_scope.rb', line 11

def internal_object
  @internal_object ||= self.klass.send(:find, :all, :params => self.scopes[self.current_scope])
end