Class: LedgerSync::Adaptors::NetSuite::LedgerSerializer
- Inherits:
-
LedgerSerializer
- Object
- LedgerSerializer
- LedgerSync::Adaptors::NetSuite::LedgerSerializer
- Defined in:
- lib/ledger_sync/adaptors/netsuite/ledger_serializer.rb
Direct Known Subclasses
Account::LedgerDeserializer, Account::LedgerSerializer, Currency::LedgerDeserializer, Currency::LedgerSerializer, Customer::LedgerDeserializer, Customer::LedgerSerializer, Vendor::LedgerDeserializer, Vendor::LedgerSerializer
Instance Attribute Summary
Attributes inherited from LedgerSerializer
Class Method Summary collapse
- .api_resource_path(resource: nil) ⇒ Object
- .api_resource_type(val = nil) ⇒ Object
- .id(**keywords) ⇒ Object
Methods inherited from LedgerSerializer
attribute, #attribute_value_from_ledger, attributes, #deserialize, #initialize, references_many, references_one, #to_ledger_hash
Methods included from Mixins::InferResourceClassMixin
Constructor Details
This class inherits a constructor from LedgerSync::Adaptors::LedgerSerializer
Class Method Details
.api_resource_path(resource: nil) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/ledger_sync/adaptors/netsuite/ledger_serializer.rb', line 10 def self.api_resource_path(resource: nil) raise 'Resource ledger_id is required to build API request path' if resource.present? && resource.ledger_id.blank? ret = "record/#{api_resource_type}" ret += "/#{resource.ledger_id}" if resource.present? ret end |
.api_resource_type(val = nil) ⇒ Object
18 19 20 21 22 |
# File 'lib/ledger_sync/adaptors/netsuite/ledger_serializer.rb', line 18 def self.api_resource_type(val = nil) raise 'api_resource_type already set' if @api_resource_type.present? && val.present? @api_resource_type ||= val end |
.id(**keywords) ⇒ Object
24 25 26 |
# File 'lib/ledger_sync/adaptors/netsuite/ledger_serializer.rb', line 24 def self.id(**keywords) super({ ledger_attribute: 'id', resource_attribute: :ledger_id }.merge(keywords)) end |