Class: GOM::Object::Collection
- Inherits:
-
Object
- Object
- GOM::Object::Collection
- Defined in:
- lib/gom/object/collection.rb
Overview
A class for a collection of objects.
Instance Method Summary collapse
-
#initialize(fetcher, storage_name) ⇒ Collection
constructor
A new instance of Collection.
- #method_missing(method_name, *arguments, &block) ⇒ Object
- #respond_to?(method_name) ⇒ Boolean
- #total_count ⇒ Object
Constructor Details
#initialize(fetcher, storage_name) ⇒ Collection
Returns a new instance of Collection.
5 6 7 |
# File 'lib/gom/object/collection.rb', line 5 def initialize(fetcher, storage_name) @fetcher, @storage_name = fetcher, storage_name end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *arguments, &block) ⇒ Object
17 18 19 20 |
# File 'lib/gom/object/collection.rb', line 17 def method_missing(method_name, *arguments, &block) load unless (@objects || @object_proxies || @rows) (@objects || @object_proxies || @rows).send method_name, *arguments, &block end |
Instance Method Details
#respond_to?(method_name) ⇒ Boolean
13 14 15 |
# File 'lib/gom/object/collection.rb', line 13 def respond_to?(method_name) (@object_proxies || @rows).respond_to?(method_name) end |
#total_count ⇒ Object
9 10 11 |
# File 'lib/gom/object/collection.rb', line 9 def total_count @fetcher.total_count end |