Class: Myfinance::Resources::SaleAccount
- Inherits:
-
Base
- Object
- Base
- Myfinance::Resources::SaleAccount
show all
- Defined in:
- lib/myfinance/resources/sale_account.rb
Instance Attribute Summary
Attributes inherited from Base
#http
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#create(params = {}) ⇒ Object
17
18
19
20
21
22
|
# File 'lib/myfinance/resources/sale_account.rb', line 17
def create(params = {})
path = "/sale_accounts/"
http.post(path, body: { sale_account: params }) do |response|
respond_with_object(response, "sale_account")
end
end
|
#destroy(sale_account_id, params = {}) ⇒ Object
31
32
33
34
35
36
|
# File 'lib/myfinance/resources/sale_account.rb', line 31
def destroy(sale_account_id, params = {})
path = "/sale_accounts/#{sale_account_id}"
http.delete(path, body: { sale_account: params }) do |response|
response
end
end
|
#find(sale_account_id) ⇒ Object
10
11
12
13
14
15
|
# File 'lib/myfinance/resources/sale_account.rb', line 10
def find(sale_account_id)
path = "/sale_accounts/#{sale_account_id}"
http.get(path, body: {}) do |response|
respond_with_object(response, "sale_account")
end
end
|
#find_all ⇒ Object
4
5
6
7
8
|
# File 'lib/myfinance/resources/sale_account.rb', line 4
def find_all
http.get("/sale_accounts", body: {}) do |response|
respond_with_collection(response)
end
end
|
#update(sale_account_id, params = {}) ⇒ Object
24
25
26
27
28
29
|
# File 'lib/myfinance/resources/sale_account.rb', line 24
def update(sale_account_id, params = {})
path = "/sale_accounts/#{sale_account_id}"
http.put(path, body: { sale_account: params }) do |response|
respond_with_object(response, "sale_account")
end
end
|