Class: Holoserve::Connector::Pairs
- Inherits:
-
Object
- Object
- Holoserve::Connector::Pairs
- Defined in:
- lib/holoserve/connector/pairs.rb
Instance Method Summary collapse
- #download(id) ⇒ Object
- #ids ⇒ Object
-
#initialize(client) ⇒ Pairs
constructor
A new instance of Pairs.
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. unless error.status_code == 404 nil end |
#ids ⇒ Object
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 |