Class: BlockScore::Candidates
- Inherits:
-
Object
- Object
- BlockScore::Candidates
- Defined in:
- lib/blockscore/candidates.rb
Constant Summary collapse
- PATH =
'/candidates'
Instance Method Summary collapse
- #all(count = nil, offset = nil, options = {}) ⇒ Object
- #create(options = {}) ⇒ Object
-
#delete(candidate_id) ⇒ Object
DELETE api.blockscore.com/candidates/CANDIDATE_ID.
-
#edit(candidate_id, options = {}) ⇒ Object
PATCH api.blockscore.com/candidates/CANDIDATE_ID.
- #history(candidate_id) ⇒ Object
- #hits(candidate_id) ⇒ Object
-
#initialize(client) ⇒ Candidates
constructor
A new instance of Candidates.
-
#retrieve(candidate_id) ⇒ Object
GET api.blockscore.com/candidates/CANDIDATE_ID.
Constructor Details
#initialize(client) ⇒ Candidates
Returns a new instance of Candidates.
5 6 7 |
# File 'lib/blockscore/candidates.rb', line 5 def initialize(client) @client = client end |
Instance Method Details
#all(count = nil, offset = nil, options = {}) ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/blockscore/candidates.rb', line 30 def all(count = nil, offset = nil, = {}) body = (.include? :body) ? [:body] : {} body[:count] = count body[:offset] = offset @client.get PATH, body end |
#create(options = {}) ⇒ Object
10 11 12 |
# File 'lib/blockscore/candidates.rb', line 10 def create( = {}) response = @client.post PATH, end |
#delete(candidate_id) ⇒ Object
DELETE api.blockscore.com/candidates/CANDIDATE_ID
20 21 22 |
# File 'lib/blockscore/candidates.rb', line 20 def delete(candidate_id) response = @client.delete "#{PATH}/#{candidate_id}" end |
#edit(candidate_id, options = {}) ⇒ Object
PATCH api.blockscore.com/candidates/CANDIDATE_ID
15 16 17 |
# File 'lib/blockscore/candidates.rb', line 15 def edit(candidate_id, = {}) response = @client.put "#{PATH}/#{candidate_id}", end |
#history(candidate_id) ⇒ Object
40 41 42 |
# File 'lib/blockscore/candidates.rb', line 40 def history(candidate_id) response = @client.get "#{PATH}/#{candidate_id}/history" end |
#hits(candidate_id) ⇒ Object
45 46 47 |
# File 'lib/blockscore/candidates.rb', line 45 def hits(candidate_id) response = @client.get "#{PATH}/#{candidate_id}/hits" end |
#retrieve(candidate_id) ⇒ Object
GET api.blockscore.com/candidates/CANDIDATE_ID
25 26 27 |
# File 'lib/blockscore/candidates.rb', line 25 def retrieve(candidate_id) response = @client.get "#{PATH}/#{candidate_id}" end |