Module: Bcoin::Client::HttpMethods

Included in:
Base, Collection
Defined in:
lib/bcoin/client/http_methods.rb

Instance Method Summary collapse

Instance Method Details

#base_pathObject

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, options = {}
  options[:token] = wallet_token if wallet_token
  response = @client.delete base_path + path, options
  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, options = {}
  options[:token] = wallet_token if wallet_token
  response = @client.get base_path + path, options
  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, options = {}
  options[:token] = wallet_token if wallet_token
  response = @client.post base_path + path, options
  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, options = {}
  options[:token] = wallet_token if wallet_token
  response = @client.put base_path + path, options
  set_error_from response
  response
end

#wallet_tokenObject

Override this is sub class



39
40
41
# File 'lib/bcoin/client/http_methods.rb', line 39

def wallet_token
  nil
end