Class: Nfe::LegalEntityStateTaxResponse

Inherits:
Data
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLegalEntityStateTaxResponse

Returns a new instance of LegalEntityStateTaxResponse.

Parameters:



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

Returns the value of attribute legal_entity.

Returns:



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.

Parameters:

  • payload (Hash, nil)

    the parsed response body.

Returns:



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

.newinstance

Parameters:

Returns:

  • (instance)


47
# File 'sig/nfe/resources/dto/legal_entity_lookup/legal_entity_responses.rbs', line 47

def self.new: (legal_entity: Nfe::StateTaxLegalEntity?) -> instance