Class: Clearbit::Watchlist::Candidate

Inherits:
Clearbit::Watchlist show all
Defined in:
lib/clearbit/watchlist.rb

Constant Summary

Constants inherited from Resource

Resource::OPTION_KEYS

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Clearbit::Watchlist

search

Methods inherited from Base

key, key=, #pending?, version=

Methods inherited from Resource

delete, endpoint, get, options, parse_values, path, post, put, request, uri, #uri, url

Methods inherited from Mash

#custom_reader, #custom_writer, #deep_merge, #deep_update, #delete, #dup, #fetch, #id, #initialize, #initializing_reader, #key?, #method_missing, new, #regular_dup, #replace, #respond_to?, #shallow_merge, #shallow_update, #type, #underbang_reader

Constructor Details

This class inherits a constructor from Clearbit::Mash

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Clearbit::Mash

Class Method Details

.all(values) ⇒ Object



27
28
29
30
# File 'lib/clearbit/watchlist.rb', line 27

def self.all(values)
  response = get('', values)
  self.new(response)
end

.create(values) ⇒ Object



32
33
34
35
# File 'lib/clearbit/watchlist.rb', line 32

def self.create(values)
  response = post('', values)
  self.new(response)
end

.find(id, values) ⇒ Object



22
23
24
25
# File 'lib/clearbit/watchlist.rb', line 22

def self.find(id, values)
  response = get(id, values)
  self.new(response)
end

Instance Method Details

#destroyObject



37
38
39
# File 'lib/clearbit/watchlist.rb', line 37

def destroy
  self.class.delete(id)
end