Class: Quovo::Api::History
- Inherits:
-
Base
- Object
- Base
- Quovo::Api::History
show all
- Defined in:
- lib/quovo/api/history.rb
Instance Attribute Summary
Attributes inherited from Base
#token
Instance Method Summary
collapse
Methods inherited from Base
#api, #initialize
Methods included from Request
#request
Instance Method Details
#for_account(id, params = {}) ⇒ Object
17
18
19
20
21
22
23
24
|
# File 'lib/quovo/api/history.rb', line 17
def for_account(id, params = {})
id.require!(as: :id)
params.permit!(:start_date, :end_date, :start_id, :end_id, :count)
api(:get, "/accounts/#{id}/history", params)
.fetch('history')
.cast(Transaction)
.sort_by(&:sort_key)
end
|
#for_portfolio(id, params = {}) ⇒ Object
26
27
28
29
30
31
32
33
|
# File 'lib/quovo/api/history.rb', line 26
def for_portfolio(id, params = {})
id.require!(as: :id)
params.permit!(:start_date, :end_date, :start_id, :end_id, :count)
api(:get, "/portfolios/#{id}/history", params)
.fetch('history')
.cast(Transaction)
.sort_by(&:sort_key)
end
|
#for_user(id, params = {}) ⇒ Object
8
9
10
11
12
13
14
15
|
# File 'lib/quovo/api/history.rb', line 8
def for_user(id, params = {})
id.require!(as: :id)
params.permit!(:start_date, :end_date, :start_id, :end_id, :count)
api(:get, "/users/#{id}/history", params)
.fetch('history')
.cast(Transaction)
.sort_by(&:sort_key)
end
|
#update_transaction(id, params = {}) ⇒ Object
35
36
37
38
39
40
41
|
# File 'lib/quovo/api/history.rb', line 35
def update_transaction(id, params = {})
id.require!(as: :id)
params.permit!(:expense_category)
api(:put, "/history/#{id}", params)
.fetch('history')
.cast(Transaction)
end
|