Class: WebHook

Inherits:
Base
  • Object
show all
Defined in:
lib/blocksdk_ruby/webhook.rb

Instance Attribute Summary

Attributes inherited from Base

#api_token

Instance Method Summary collapse

Methods inherited from Base

#initialize, #request

Constructor Details

This class inherits a constructor from Base

Instance Method Details

#create(request = {}) ⇒ Object



5
6
7
# File 'lib/blocksdk_ruby/webhook.rb', line 5

def create(request={})
	return request("POST","/hooks",{"callback_url"=>request['callback_url'],"symbol"=>request['symbol'],"address"=>request['address']})
end

#delete(request = {}) ⇒ Object



19
20
21
# File 'lib/blocksdk_ruby/webhook.rb', line 19

def delete(request={})
	return request("DELETE","/hooks/" +    (request['hook_id']).to_s)
end

#get(request = {}) ⇒ Object



15
16
17
# File 'lib/blocksdk_ruby/webhook.rb', line 15

def get(request={})
	return request("GET","/hooks/" +    (request['hook_id']).to_s)
end

#getHookResponses(request = {}) ⇒ Object



29
30
31
32
33
# File 'lib/blocksdk_ruby/webhook.rb', line 29

def getHookResponses(request={})
	request["offset"].to_s.empty? ? request['offset'] = 0 : request["offset"]
	request["limit"].to_s.empty? ? request['limit'] = 10 : request["limit"]
	return request("GET","/hooks/" + (request['hook_id']).to_s + "/responses",{"offset"=>request['offset'],"limit"=>request['limit']})			
end

#getResponses(request = {}) ⇒ Object



23
24
25
26
27
# File 'lib/blocksdk_ruby/webhook.rb', line 23

def getResponses(request = {})
	request["offset"].to_s.empty? ? request['offset'] = 0 : request["offset"]
	request["limit"].to_s.empty? ? request['limit'] = 10 : request["limit"]
	return request("GET","/hooks/responses",{"offset"=>request['offset'],"limit"=>request['limit']})			
end

#list(request = {}) ⇒ Object



9
10
11
12
13
# File 'lib/blocksdk_ruby/webhook.rb', line 9

def list(request = {})
	request["offset"].to_s.empty? ? request['offset'] = 0 : request["offset"]
	request["limit"].to_s.empty? ? request['limit'] = 10 : request["limit"]			
	return request("GET","/hooks",{"offset"=>request['offset'],"limit"=>request['limit']})
end