Class: Nfe::LegalEntityBasicInfoResponse

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 basicInfo lookup response.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLegalEntityBasicInfoResponse

Returns a new instance of LegalEntityBasicInfoResponse.

Parameters:



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

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

Instance Attribute Details

Returns the value of attribute legal_entity.

Returns:



33
34
35
# File 'sig/nfe/resources/dto/legal_entity_lookup/legal_entity_responses.rbs', line 33

def legal_entity
  @legal_entity
end

Class Method Details

.from_api(payload) ⇒ Nfe::LegalEntityBasicInfoResponse?

Returns nil when payload is nil.

Parameters:

  • payload (Hash, nil)

    the parsed response body.

Returns:



72
73
74
75
76
77
78
# File 'lib/nfe/resources/dto/legal_entity_lookup/legal_entity_responses.rb', line 72

def self.from_api(payload)
  return nil if payload.nil?

  new(
    legal_entity: Nfe::LegalEntity.from_api(payload["legalEntity"] || payload)
  )
end

.newinstance

Parameters:

Returns:

  • (instance)


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

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