Class: Nfe::TaxCoupon::Address
- Inherits:
-
Data
- Object
- Data
- Nfe::TaxCoupon::Address
- 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
-
#city ⇒ Object
readonly
Returns the value of attribute city.
-
#country ⇒ String?
readonly
Returns the value of attribute country.
-
#district ⇒ String?
readonly
Returns the value of attribute district.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#postal_code ⇒ Object
readonly
Returns the value of attribute postal_code.
-
#state ⇒ String?
readonly
Returns the value of attribute state.
-
#street ⇒ String?
readonly
Returns the value of attribute street.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Address
constructor
A new instance of Address.
Constructor Details
#initialize ⇒ Address
Returns a new instance of Address.
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
#city ⇒ Object (readonly)
Returns the value of attribute city.
45 46 47 |
# File 'sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs', line 45 def city @city end |
#country ⇒ String? (readonly)
Returns the value of attribute country.
47 48 49 |
# File 'sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs', line 47 def country @country end |
#district ⇒ String? (readonly)
Returns the value of attribute district.
43 44 45 |
# File 'sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs', line 43 def district @district end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
42 43 44 |
# File 'sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs', line 42 def number @number end |
#postal_code ⇒ Object (readonly)
Returns the value of attribute postal_code.
44 45 46 |
# File 'sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs', line 44 def postal_code @postal_code end |
#state ⇒ String? (readonly)
Returns the value of attribute state.
46 47 48 |
# File 'sig/nfe/resources/dto/consumer_invoice_query/tax_coupon.rbs', line 46 def state @state end |
#street ⇒ String? (readonly)
Returns the value of attribute street.
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?
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 |
.new ⇒ 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
|