Class: SynapsePay::UserEndpoint
Instance Attribute Summary
Attributes inherited from APIEndpoint
#client
Instance Method Summary
collapse
Methods inherited from APIEndpoint
#initialize
Instance Method Details
#retrieve(params = {}, headers = {}) ⇒ Object
4
5
6
7
8
|
# File 'lib/synapse_pay/endpoints/user_endpoint.rb', line 4
def retrieve(params={}, ={})
method = APIMethod.new(:post, "/user/show", params, , self)
json = @client.execute(method)
User.new(json[:user], method, @client)
end
|
#search(query, params = {}, headers = {}) ⇒ Object
10
11
12
13
14
15
16
17
|
# File 'lib/synapse_pay/endpoints/user_endpoint.rb', line 10
def search(query, params={}, ={})
params = ParamsBuilder.merge({
:query => query,
}, params)
method = APIMethod.new(:post, "/user/customers", params, , self)
json = @client.execute(method)
APIList.new(:User, json[:customers], method, @client)
end
|
#update(params = {}, headers = {}) ⇒ Object
19
20
21
22
23
|
# File 'lib/synapse_pay/endpoints/user_endpoint.rb', line 19
def update(params={}, ={})
method = APIMethod.new(:post, "/user/edit", params, , self)
json = @client.execute(method)
User.new(json[:user], method, @client)
end
|