Class: Nova::API::Resource::CurrentAsset

Inherits:
Base show all
Defined in:
lib/nova/api/resource/current_asset.rb

Direct Known Subclasses

Bank, Card, Cash

Constant Summary collapse

ALLOWED_ATTRIBUTES =
%i[]

Constants inherited from Base

Base::PRODUCTION_HOST, Base::SCHEME, Base::STAGING_HOST

Constants inherited from Utils::BaseStruct

Utils::BaseStruct::DATE_REGEX

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

base_url

Methods inherited from Utils::BaseStruct

#allowed_attributes

Class Method Details

.endpointObject



13
14
15
# File 'lib/nova/api/resource/current_asset.rb', line 13

def self.endpoint
  '/api/current_assets'
end

.statement(parameters = {}) ⇒ Object



17
18
19
# File 'lib/nova/api/resource/current_asset.rb', line 17

def self.statement(parameters = {})
  do_get("#{endpoint}/statement", parameters.to_h, Nova::API::Resource::Response::CurrentAssetStatement.new)
end

Instance Method Details

#endpointObject



27
28
29
# File 'lib/nova/api/resource/current_asset.rb', line 27

def endpoint
  "/api/current_assets"
end

#statement(initial_date, final_date) ⇒ Object



21
22
23
24
25
# File 'lib/nova/api/resource/current_asset.rb', line 21

def statement(initial_date, final_date)
  protect_operation_from_missing_value

  self.class.do_get("#{endpoint}/statement", { company_id: company.id, current_asset_id: id, final_date: final_date, initial_date: initial_date }, Nova::API::Resource::Response::CurrentAssetStatement.new)
end