Class: Nfe::LegalEntityStateTaxResponse
- Inherits:
-
Data
- Object
- Data
- Nfe::LegalEntityStateTaxResponse
- Defined in:
- lib/nfe/resources/dto/legal_entity_lookup/legal_entity_responses.rb,
sig/nfe/resources/dto/legal_entity_lookup/legal_entity_responses.rbs
Overview
Immutable wrapper for a stateTaxInfo lookup response. The body wraps a
legalEntity object with the state-tax shape (StateTaxLegalEntity);
all state-tax data lives there (inside stateTaxes), not at the top level.
Instance Attribute Summary collapse
-
#legal_entity ⇒ Nfe::StateTaxLegalEntity?
readonly
Returns the value of attribute legal_entity.
Class Method Summary collapse
-
.from_api(payload) ⇒ Nfe::LegalEntityStateTaxResponse?
nilwhenpayloadisnil. - .new ⇒ instance
Instance Method Summary collapse
-
#initialize ⇒ LegalEntityStateTaxResponse
constructor
A new instance of LegalEntityStateTaxResponse.
Constructor Details
#initialize ⇒ LegalEntityStateTaxResponse
Returns a new instance of LegalEntityStateTaxResponse.
49 |
# File 'sig/nfe/resources/dto/legal_entity_lookup/legal_entity_responses.rbs', line 49
def initialize: (legal_entity: Nfe::StateTaxLegalEntity?) -> void
|
Instance Attribute Details
#legal_entity ⇒ Nfe::StateTaxLegalEntity? (readonly)
Returns the value of attribute legal_entity.
43 44 45 |
# File 'sig/nfe/resources/dto/legal_entity_lookup/legal_entity_responses.rbs', line 43 def legal_entity @legal_entity end |
Class Method Details
.from_api(payload) ⇒ Nfe::LegalEntityStateTaxResponse?
Returns nil when payload is nil.
87 88 89 90 91 92 93 |
# File 'lib/nfe/resources/dto/legal_entity_lookup/legal_entity_responses.rb', line 87 def self.from_api(payload) return nil if payload.nil? new( legal_entity: Nfe::StateTaxLegalEntity.from_api(payload["legalEntity"] || payload) ) end |
.new ⇒ instance
47 |
# File 'sig/nfe/resources/dto/legal_entity_lookup/legal_entity_responses.rbs', line 47
def self.new: (legal_entity: Nfe::StateTaxLegalEntity?) -> instance
|