Class: PipeLineDealer::Collection

Inherits:
Object
  • Object
show all
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

PipeLineDealer::CustomField::Collection

Defined Under Namespace

Modules: Concerns

Constant Summary collapse

DEFAULT_OPTIONS =
{ cached: false }

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Concerns::CreateAndUpdate

#create, #new

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 = {})
  @options = DEFAULT_OPTIONS.merge(options)
  @client = client
  @klass  = options[:klass]
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



8
9
10
# File 'lib/pipe_line_dealer/collection.rb', line 8

def client
  @client
end

#klassObject (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_urlObject



20
21
22
# File 'lib/pipe_line_dealer/collection.rb', line 20

def collection_url
  @klass.instance_variable_get(:@collection_url)
end

#to_sObject



16
17
18
# File 'lib/pipe_line_dealer/collection.rb', line 16

def to_s
  "<PipeLineDealer::Collection:#{__id__} @klass=#{@klass.inspect}>"
end