Class: NfeReader::Address
- Inherits:
-
Object
- Object
- NfeReader::Address
- Includes:
- AttributeHelper
- Defined in:
- lib/nfe_reader/address.rb
Constant Summary
Constants included from AttributeHelper
NfeReader::AttributeHelper::WITHELIST
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#city ⇒ Object
readonly
Returns the value of attribute city.
-
#city_code ⇒ Object
readonly
Returns the value of attribute city_code.
-
#cnpj ⇒ Object
readonly
Returns the value of attribute cnpj.
-
#complement ⇒ Object
readonly
Returns the value of attribute complement.
-
#country ⇒ Object
readonly
Returns the value of attribute country.
-
#country_code ⇒ Object
readonly
Returns the value of attribute country_code.
-
#cpf ⇒ Object
readonly
Returns the value of attribute cpf.
-
#neighborhood ⇒ Object
readonly
Returns the value of attribute neighborhood.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#phone ⇒ Object
readonly
Returns the value of attribute phone.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#zip_code ⇒ Object
readonly
Returns the value of attribute zip_code.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Address
constructor
A new instance of Address.
Methods included from AttributeHelper
#attributes, #attributes_to_hash
Constructor Details
#initialize(attrs = {}) ⇒ Address
Returns a new instance of Address.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/nfe_reader/address.rb', line 9 def initialize(attrs= {}) # CNPJ @cnpj = attrs[:CNPJ] # CPF @cpf = attrs[:CPF] # Logradouo @address = attrs[:xLgr] # Numero @number = attrs[:nro] # Complemento @complement = attrs[:xCpl] # Bairro @neighborhood = attrs[:xBairro] # Codigo IBGE Cidade @city_code = attrs[:cMun] # Nome Cidade @city = attrs[:xMun] # CEP @zip_code = attrs[:CEP] # Estado @state = attrs[:UF] # Codigo Pais @country_code = attrs[:cPais] # Pais @country = attrs[:xPais] # Telefone @phone = attrs[:fone] end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
5 6 7 |
# File 'lib/nfe_reader/address.rb', line 5 def address @address end |
#city ⇒ Object (readonly)
Returns the value of attribute city.
5 6 7 |
# File 'lib/nfe_reader/address.rb', line 5 def city @city end |
#city_code ⇒ Object (readonly)
Returns the value of attribute city_code.
5 6 7 |
# File 'lib/nfe_reader/address.rb', line 5 def city_code @city_code end |
#cnpj ⇒ Object (readonly)
Returns the value of attribute cnpj.
5 6 7 |
# File 'lib/nfe_reader/address.rb', line 5 def cnpj @cnpj end |
#complement ⇒ Object (readonly)
Returns the value of attribute complement.
5 6 7 |
# File 'lib/nfe_reader/address.rb', line 5 def complement @complement end |
#country ⇒ Object (readonly)
Returns the value of attribute country.
5 6 7 |
# File 'lib/nfe_reader/address.rb', line 5 def country @country end |
#country_code ⇒ Object (readonly)
Returns the value of attribute country_code.
5 6 7 |
# File 'lib/nfe_reader/address.rb', line 5 def country_code @country_code end |
#cpf ⇒ Object (readonly)
Returns the value of attribute cpf.
5 6 7 |
# File 'lib/nfe_reader/address.rb', line 5 def cpf @cpf end |
#neighborhood ⇒ Object (readonly)
Returns the value of attribute neighborhood.
5 6 7 |
# File 'lib/nfe_reader/address.rb', line 5 def neighborhood @neighborhood end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
5 6 7 |
# File 'lib/nfe_reader/address.rb', line 5 def number @number end |
#phone ⇒ Object (readonly)
Returns the value of attribute phone.
5 6 7 |
# File 'lib/nfe_reader/address.rb', line 5 def phone @phone end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
5 6 7 |
# File 'lib/nfe_reader/address.rb', line 5 def state @state end |
#zip_code ⇒ Object (readonly)
Returns the value of attribute zip_code.
5 6 7 |
# File 'lib/nfe_reader/address.rb', line 5 def zip_code @zip_code end |