Class: BlockScore::Companies

Inherits:
Object
  • Object
show all
Defined in:
lib/blockscore/companies.rb

Constant Summary collapse

PATH =
'/companies'

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Companies

Returns a new instance of Companies.



5
6
7
# File 'lib/blockscore/companies.rb', line 5

def initialize(client)
  @client = client
end

Instance Method Details

#all(count = nil, offset = nil, options = {}) ⇒ Object

‘/companies’ GET



27
28
29
30
31
32
33
34
# File 'lib/blockscore/companies.rb', line 27

def all(count = nil, offset = nil, options = {})
  body = (options.include? :body) ? options[:body] : {}

  body[:count] = count
  body[:offset] = offset

  @client.get PATH, body
end

#create(options = {}) ⇒ Object

/companies POST



12
13
14
# File 'lib/blockscore/companies.rb', line 12

def create(options = {})
  response = @client.post PATH, options
end

#retrieve(id, options = {}) ⇒ Object

/companies/:id GET



19
20
21
22
# File 'lib/blockscore/companies.rb', line 19

def retrieve(id, options = {})
  body = (options.include? :query) ? options[:body] : {}
  response = @client.get "#{PATH}/#{id.to_s}", body
end