Module: Bcoin::Client::HttpMethods
- Included in:
- Base, Collection
- Defined in:
- lib/bcoin/client/http_methods.rb
Instance Method Summary collapse
-
#base_path ⇒ Object
Override this in sub class.
- #delete(path, options = {}) ⇒ Object
- #get(path, options = {}) ⇒ Object
- #post(path, options = {}) ⇒ Object
- #put(path, options = {}) ⇒ Object
-
#wallet_token ⇒ Object
Override this is sub class.
Instance Method Details
#base_path ⇒ Object
Override this in sub class
6 7 8 |
# File 'lib/bcoin/client/http_methods.rb', line 6 def base_path '/base' end |
#delete(path, options = {}) ⇒ Object
31 32 33 34 35 36 |
# File 'lib/bcoin/client/http_methods.rb', line 31 def delete path, = {} [:token] = wallet_token if wallet_token response = @client.delete base_path + path, set_error_from response response end |
#get(path, options = {}) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/bcoin/client/http_methods.rb', line 10 def get path, = {} [:token] = wallet_token if wallet_token response = @client.get base_path + path, set_error_from response response end |
#post(path, options = {}) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/bcoin/client/http_methods.rb', line 17 def post path, = {} [:token] = wallet_token if wallet_token response = @client.post base_path + path, set_error_from response response end |
#put(path, options = {}) ⇒ Object
24 25 26 27 28 29 |
# File 'lib/bcoin/client/http_methods.rb', line 24 def put path, = {} [:token] = wallet_token if wallet_token response = @client.put base_path + path, set_error_from response response end |
#wallet_token ⇒ Object
Override this is sub class
39 40 41 |
# File 'lib/bcoin/client/http_methods.rb', line 39 def wallet_token nil end |