Class: PipeLineDealer::Collection
- Inherits:
-
Object
- Object
- PipeLineDealer::Collection
- Includes:
- Concerns::CreateAndUpdate, Concerns::Fetching
- Defined in:
- lib/pipe_line_dealer/collection.rb,
lib/pipe_line_dealer/collection/concerns.rb,
lib/pipe_line_dealer/collection/concerns/fetching.rb,
lib/pipe_line_dealer/collection/concerns/results_fetcher.rb,
lib/pipe_line_dealer/collection/concerns/create_and_update.rb
Direct Known Subclasses
Defined Under Namespace
Modules: Concerns
Constant Summary collapse
- DEFAULT_OPTIONS =
{ cached: false }
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
Instance Method Summary collapse
- #collection_url ⇒ Object
-
#initialize(client, options = {}) ⇒ Collection
constructor
A new instance of Collection.
- #to_s ⇒ Object
Methods included from Concerns::CreateAndUpdate
Methods included from Concerns::Fetching
#all, #each, #find, #first, #limit, #on_new_defaults, #to_a, #where
Constructor Details
#initialize(client, options = {}) ⇒ Collection
Returns a new instance of Collection.
10 11 12 13 14 |
# File 'lib/pipe_line_dealer/collection.rb', line 10 def initialize(client, = {}) @options = DEFAULT_OPTIONS.merge() @client = client @klass = [:klass] end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
8 9 10 |
# File 'lib/pipe_line_dealer/collection.rb', line 8 def client @client end |
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
9 10 11 |
# File 'lib/pipe_line_dealer/collection.rb', line 9 def klass @klass end |
Instance Method Details
#collection_url ⇒ Object
20 21 22 |
# File 'lib/pipe_line_dealer/collection.rb', line 20 def collection_url @klass.instance_variable_get(:@collection_url) end |
#to_s ⇒ Object
16 17 18 |
# File 'lib/pipe_line_dealer/collection.rb', line 16 def to_s "<PipeLineDealer::Collection:#{__id__} @klass=#{@klass.inspect}>" end |