Class: Nfe::LegalEntityStateTaxForInvoiceResponse

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 stateTaxForInvoice / stateTaxSuggestedForInvoice lookup response. Same legalEntity state-tax shape as LegalEntityStateTaxResponse; the per-IE status enum is extended for invoice evaluation but the structure is identical.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLegalEntityStateTaxForInvoiceResponse

Returns a new instance of LegalEntityStateTaxForInvoiceResponse.

Parameters:



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

def initialize: (legal_entity: Nfe::StateTaxLegalEntity?) -> void

Instance Attribute Details

Returns the value of attribute legal_entity.

Returns:



53
54
55
# File 'sig/nfe/resources/dto/legal_entity_lookup/legal_entity_responses.rbs', line 53

def legal_entity
  @legal_entity
end

Class Method Details

.from_api(payload) ⇒ Nfe::LegalEntityStateTaxForInvoiceResponse?

Returns nil when payload is nil.

Parameters:

  • payload (Hash, nil)

    the parsed response body.

Returns:



103
104
105
106
107
108
109
# File 'lib/nfe/resources/dto/legal_entity_lookup/legal_entity_responses.rb', line 103

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)


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

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