Class: Nfe::TaxCoupon::Address

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

Overview

Pragmatic subset of a CFe-SAT address (+enderEmit+ / entrega.address).

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: (Object)
  • district: (String, nil)
  • postal_code: (Object)
  • city: (Object)
  • state: (String, nil)
  • country: (String, nil)


51
# File 'sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs', line 51

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

Instance Attribute Details

#cityObject (readonly)

Returns the value of attribute city.

Returns:

  • (Object)


45
46
47
# File 'sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs', line 45

def city
  @city
end

#countryString? (readonly)

Returns the value of attribute country.

Returns:

  • (String, nil)


47
48
49
# File 'sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs', line 47

def country
  @country
end

#districtString? (readonly)

Returns the value of attribute district.

Returns:

  • (String, nil)


43
44
45
# File 'sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs', line 43

def district
  @district
end

#numberObject (readonly)

Returns the value of attribute number.

Returns:

  • (Object)


42
43
44
# File 'sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs', line 42

def number
  @number
end

#postal_codeObject (readonly)

Returns the value of attribute postal_code.

Returns:

  • (Object)


44
45
46
# File 'sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs', line 44

def postal_code
  @postal_code
end

#stateString? (readonly)

Returns the value of attribute state.

Returns:

  • (String, nil)


46
47
48
# File 'sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs', line 46

def state
  @state
end

#streetString? (readonly)

Returns the value of attribute street.

Returns:

  • (String, nil)


41
42
43
# File 'sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs', line 41

def street
  @street
end

Class Method Details

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

Parameters:

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

Returns:



91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/nfe/resources/dto/consumer_invoice_query/tax_coupon.rb', line 91

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: (Object)
  • district: (String, nil)
  • postal_code: (Object)
  • city: (Object)
  • state: (String, nil)
  • country: (String, nil)

Returns:

  • (instance)


50
# File 'sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs', line 50

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