Class: Holoserve::Connector::Pairs

Inherits:
Object
  • Object
show all
Defined in:
lib/holoserve/connector/pairs.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Pairs

Returns a new instance of Pairs.



5
6
7
# File 'lib/holoserve/connector/pairs.rb', line 5

def initialize(client)
  @client = client
end

Instance Method Details

#download(id) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/holoserve/connector/pairs.rb', line 15

def download(id)
  Transport::JSON.request :get,
                          "#{@client.url}/pairs/#{id}",
                          :expected_status_code => 200
rescue Transport::UnexpectedStatusCodeError => error
  raise Holoserve::Connector::Error, error.message unless error.status_code == 404
  nil
end

#idsObject



9
10
11
12
13
# File 'lib/holoserve/connector/pairs.rb', line 9

def ids
  Transport::JSON.request :get,
                          "#{@client.url}/pairs",
                          :expected_status_code => 200
end