Class: Myfinance::Resources::SaleAccount

Inherits:
Base
  • Object
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

Constructor Details

This class inherits a constructor from Myfinance::Resources::Base

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(, params = {})
  path = "/sale_accounts/#{}"
  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()
  path = "/sale_accounts/#{}"
  http.get(path, body: {}) do |response|
    respond_with_object(response, "sale_account")
  end
end

#find_allObject



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(, params = {})
  path = "/sale_accounts/#{}"
  http.put(path, body: { sale_account: params }) do |response|
    respond_with_object(response, "sale_account")
  end
end