Class: Myfinance::Resources::Tax

Inherits:
Base
  • Object
show all
Defined in:
lib/myfinance/resources/tax.rb

Overview

A wrapper to Myfinance taxes API

[API] Documentation: https://app.myfinance.com.br/docs/api/taxes

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

#find(id) ⇒ Object

Show a tax

[API] Method: GET /taxes/:id

Documentation: https://app.myfinance.com.br/docs/api/taxes#get_show


32
33
34
35
36
# File 'lib/myfinance/resources/tax.rb', line 32

def find(id)
  http.get("/taxes/#{id}", body: {}) do |response|
    respond_with_object(response, "tax")
  end
end

#find_allObject

List all taxes

[API] Method: GET /taxes

Documentation: https://app.myfinance.com.br/docs/api/taxes#get_index


18
19
20
21
22
# File 'lib/myfinance/resources/tax.rb', line 18

def find_all
  http.get("/taxes", body: {}) do |response|
    respond_with_collection(response)
  end
end