Class: FioAPI::List

Inherits:
Base
  • Object
show all
Defined in:
lib/base/list.rb

Overview

Base class for request to transactions listing and account information

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from FioAPI::Base

Instance Attribute Details

#requestObject

Returns the value of attribute request.



4
5
6
# File 'lib/base/list.rb', line 4

def request
  @request
end

#responseObject

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  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  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_fetchObject

Allow request transactions from last request

Returns:

List insatnce with  info and transactions list

fioapi.fio.cz/v1/rest/last/(token)/transactions.(format)



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  info and transactions list

fioapi.fio.cz/v1/rest/set-last-date/(token)/(rrrr-mm-dd)/



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  info and transactions list

fioapi.fio.cz/v1/rest/set-last-id/(token)/(id)/



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