Class: NfeReader::Address

Inherits:
Object
  • Object
show all
Includes:
AttributeHelper
Defined in:
lib/nfe_reader/address.rb

Constant Summary

Constants included from AttributeHelper

NfeReader::AttributeHelper::WITHELIST

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#addressObject (readonly)

Returns the value of attribute address.



5
6
7
# File 'lib/nfe_reader/address.rb', line 5

def address
  @address
end

#cityObject (readonly)

Returns the value of attribute city.



5
6
7
# File 'lib/nfe_reader/address.rb', line 5

def city
  @city
end

#city_codeObject (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

#cnpjObject (readonly)

Returns the value of attribute cnpj.



5
6
7
# File 'lib/nfe_reader/address.rb', line 5

def cnpj
  @cnpj
end

#complementObject (readonly)

Returns the value of attribute complement.



5
6
7
# File 'lib/nfe_reader/address.rb', line 5

def complement
  @complement
end

#countryObject (readonly)

Returns the value of attribute country.



5
6
7
# File 'lib/nfe_reader/address.rb', line 5

def country
  @country
end

#country_codeObject (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

#cpfObject (readonly)

Returns the value of attribute cpf.



5
6
7
# File 'lib/nfe_reader/address.rb', line 5

def cpf
  @cpf
end

#neighborhoodObject (readonly)

Returns the value of attribute neighborhood.



5
6
7
# File 'lib/nfe_reader/address.rb', line 5

def neighborhood
  @neighborhood
end

#numberObject (readonly)

Returns the value of attribute number.



5
6
7
# File 'lib/nfe_reader/address.rb', line 5

def number
  @number
end

#phoneObject (readonly)

Returns the value of attribute phone.



5
6
7
# File 'lib/nfe_reader/address.rb', line 5

def phone
  @phone
end

#stateObject (readonly)

Returns the value of attribute state.



5
6
7
# File 'lib/nfe_reader/address.rb', line 5

def state
  @state
end

#zip_codeObject (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