Class: Nfe::StateTaxLegalEntity::Address

Inherits:
Data
  • Object
show all
Defined in:
lib/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rb,
sig/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rbs

Overview

Address nested inside a state-tax registration. Pragmatic subset of the address fields exposed by the state-tax endpoints.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeAddress

Returns a new instance of Address.

Parameters:

  • street: (String, nil)
  • number: (String, nil)
  • district: (String, nil)
  • postal_code: (String, nil)
  • city: (Object)
  • state: (String, nil)
  • country: (String, nil)


14
# File 'sig/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rbs', line 14

def initialize: (street: String?, number: String?, district: String?, postal_code: String?, city: untyped, state: String?, country: String?) -> void

Instance Attribute Details

#cityObject (readonly)

Returns the value of attribute city.

Returns:

  • (Object)


8
9
10
# File 'sig/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rbs', line 8

def city
  @city
end

#countryString? (readonly)

Returns the value of attribute country.

Returns:

  • (String, nil)


10
11
12
# File 'sig/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rbs', line 10

def country
  @country
end

#districtString? (readonly)

Returns the value of attribute district.

Returns:

  • (String, nil)


6
7
8
# File 'sig/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rbs', line 6

def district
  @district
end

#numberString? (readonly)

Returns the value of attribute number.

Returns:

  • (String, nil)


5
6
7
# File 'sig/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rbs', line 5

def number
  @number
end

#postal_codeString? (readonly)

Returns the value of attribute postal_code.

Returns:

  • (String, nil)


7
8
9
# File 'sig/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rbs', line 7

def postal_code
  @postal_code
end

#stateString? (readonly)

Returns the value of attribute state.

Returns:

  • (String, nil)


9
10
11
# File 'sig/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rbs', line 9

def state
  @state
end

#streetString? (readonly)

Returns the value of attribute street.

Returns:

  • (String, nil)


4
5
6
# File 'sig/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rbs', line 4

def street
  @street
end

Class Method Details

.from_api(payload) ⇒ Nfe::StateTaxLegalEntity::Address?

Parameters:

  • payload (Hash[untyped, untyped], nil)

Returns:



28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rb', line 28

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

  new(
    street: payload["street"],
    number: payload["number"]&.to_s,
    district: payload["district"],
    postal_code: payload["postalCode"]&.to_s,
    city: payload["city"],
    state: payload["state"],
    country: payload["country"]
  )
end

.newinstance

Parameters:

  • street: (String, nil)
  • number: (String, nil)
  • district: (String, nil)
  • postal_code: (String, nil)
  • city: (Object)
  • state: (String, nil)
  • country: (String, nil)

Returns:

  • (instance)


13
# File 'sig/nfe/resources/dto/legal_entity_lookup/state_tax_legal_entity.rbs', line 13

def self.new: (street: String?, number: String?, district: String?, postal_code: String?, city: untyped, state: String?, country: String?) -> instance