Class: PipeLineDealer::CustomField::Collection

Inherits:
PipeLineDealer::Collection show all
Defined in:
lib/pipe_line_dealer/custom_field/collection.rb

Constant Summary

Constants inherited from PipeLineDealer::Collection

PipeLineDealer::Collection::DEFAULT_OPTIONS

Instance Attribute Summary

Attributes inherited from PipeLineDealer::Collection

#client, #klass

Instance Method Summary collapse

Methods inherited from PipeLineDealer::Collection

#collection_url, #to_s

Methods included from PipeLineDealer::Collection::Concerns::CreateAndUpdate

#create, #new

Methods included from PipeLineDealer::Collection::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.



4
5
6
7
# File 'lib/pipe_line_dealer/custom_field/collection.rb', line 4

def initialize(client, options={})
  options[:cached] = true
  super(client, options)
end

Instance Method Details

#[](key) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/pipe_line_dealer/custom_field/collection.rb', line 9

def [](key)
  self.all.each do |item|
    return item if item.name== key
  end

  raise PipeLineDealer::Error::NoSuchCustomField.new(key)
end