Class: Remitano::Client::Offers

Inherits:
CoinCollection show all
Defined in:
lib/remitano/client/offers.rb

Instance Attribute Summary

Attributes inherited from CoinCollection

#coin, #config

Attributes inherited from Collection

#config, #path, #resource_name

Instance Method Summary collapse

Methods inherited from CoinCollection

#initialize, of_coin

Methods inherited from Collection

#all, #create, #get, #initialize

Constructor Details

This class inherits a constructor from Remitano::Client::CoinCollection

Instance Method Details

#disable(offer_id) ⇒ Object



17
18
19
# File 'lib/remitano/client/offers.rb', line 17

def disable(offer_id)
  config.net.patch("/offers/#{offer_id}/disable?coin_currency=#{coin}").execute
end

#enable(offer_id) ⇒ Object



13
14
15
# File 'lib/remitano/client/offers.rb', line 13

def enable(offer_id)
  config.net.patch("/offers/#{offer_id}/enable?coin_currency=#{coin}").execute
end

#my_offers(side) ⇒ Object



4
5
6
# File 'lib/remitano/client/offers.rb', line 4

def my_offers(side)
  config.net.get("/offers/my_offers?offer_type=#{side}&coin_currency=#{coin}").execute.offers
end

#update(offer_id, params) ⇒ Object



8
9
10
11
# File 'lib/remitano/client/offers.rb', line 8

def update(offer_id, params)
  response = config.net.patch("/offers/#{offer_id}?coin_currency=#{coin}", params).execute
  config.action_confirmations.confirm_if_neccessary!(response)
end