Class: FioAPI::List
Overview
Base class for request to transactions listing and account information
Instance Attribute Summary collapse
-
#request ⇒ Object
Returns the value of attribute request.
-
#response ⇒ Object
Returns the value of attribute response.
Instance Method Summary collapse
-
#by_date_range(from_date, to_date) ⇒ Object
Allow request transactions in date range.
-
#by_listing_id_and_year(listing_id, year) ⇒ Object
Allow request transactions by listing_id and year.
-
#from_last_fetch ⇒ Object
Allow request transactions from last request.
-
#set_last_fetch_date(date) ⇒ Object
Allow request to set last request date.
-
#set_last_fetch_id(transaction_id) ⇒ Object
Allow request to set last transaction_id.
Methods inherited from Base
Constructor Details
This class inherits a constructor from FioAPI::Base
Instance Attribute Details
#request ⇒ Object
Returns the value of attribute request.
4 5 6 |
# File 'lib/base/list.rb', line 4 def request @request end |
#response ⇒ Object
Returns the value of attribute response.
4 5 6 |
# File 'lib/base/list.rb', line 4 def response @response end |
Instance Method Details
#by_date_range(from_date, to_date) ⇒ Object
Allow request transactions in date range
Parameters:
- from_date
-
Start date for transactions list
- to_date
-
End date for transactions list
Returns:
List insatnce with account info and transactions list
fioapi.fio.cz/v1/rest/periods/(token)/(date_from)/(date_to)/transactions.(format)
18 19 20 |
# File 'lib/base/list.rb', line 18 def by_date_range(from_date, to_date) fetch_and_deserialize_response("/periods/#{FioAPI.token}/#{from_date}/#{to_date}/transactions.json") end |
#by_listing_id_and_year(listing_id, year) ⇒ Object
Allow request transactions by listing_id and year
Parameters:
- listing_id
-
Id of listing
- year
-
Year when listing was provided
Returns:
List insatnce with account info and transactions list
fioapi.fio.cz/v1/rest/by-id/(token)/(year)/(id)/transactions.(format)
34 35 36 |
# File 'lib/base/list.rb', line 34 def by_listing_id_and_year(listing_id, year) fetch_and_deserialize_response("/by-id/#{FioAPI.token}/#{year}/#{listing_id}/transactions.json") end |
#from_last_fetch ⇒ Object
Allow request transactions from last request
Returns:
List insatnce with account info and transactions list
44 45 46 |
# File 'lib/base/list.rb', line 44 def from_last_fetch fetch_and_deserialize_response("/last/#{FioAPI.token}/transactions.json") end |
#set_last_fetch_date(date) ⇒ Object
Allow request to set last request date
Parameters:
- date
-
Date when last request was provided
Returns:
List insatnce with account info and transactions list
72 73 74 |
# File 'lib/base/list.rb', line 72 def set_last_fetch_date(date) fetch_and_deserialize_response("/set-last-date/#{FioAPI.token}/#{date}/") end |
#set_last_fetch_id(transaction_id) ⇒ Object
Allow request to set last transaction_id
Parameters:
- transaction_id
-
Id of transaction
Returns:
List insatnce with account info and transactions list
58 59 60 |
# File 'lib/base/list.rb', line 58 def set_last_fetch_id(transaction_id) fetch_and_deserialize_response("/set-last-id/#{FioAPI.token}/#{transaction_id}/") end |