Class: BrNfe::Endereco
- Inherits:
-
ActiveModelBase
- Object
- ActiveModelBase
- BrNfe::Endereco
- Defined in:
- lib/br_nfe/endereco.rb
Instance Attribute Summary collapse
-
#bairro ⇒ Object
Returns the value of attribute bairro.
-
#cep ⇒ Object
Returns the value of attribute cep.
-
#codigo_ibge_uf ⇒ Object
Código IBGE do Estado (UF) Caso não seja setado um valor no atributo, irá pegar os primeiros 2 dígitos do código IBGE do município.
-
#codigo_municipio ⇒ Object
IBGE.
-
#codigo_pais ⇒ Object
defaul: 1058 (Brasil).
-
#complemento ⇒ Object
Returns the value of attribute complemento.
-
#logradouro ⇒ Object
Returns the value of attribute logradouro.
-
#nome_municipio ⇒ Object
Returns the value of attribute nome_municipio.
-
#nome_pais ⇒ Object
defaul: BRASIL.
-
#numero ⇒ Object
Returns the value of attribute numero.
-
#uf ⇒ Object
Returns the value of attribute uf.
Attributes inherited from ActiveModelBase
Instance Method Summary collapse
Methods inherited from ActiveModelBase
#assign_attributes, #initialize
Constructor Details
This class inherits a constructor from BrNfe::ActiveModelBase
Instance Attribute Details
#bairro ⇒ Object
Returns the value of attribute bairro.
14 15 16 |
# File 'lib/br_nfe/endereco.rb', line 14 def bairro @bairro end |
#cep ⇒ Object
Returns the value of attribute cep.
19 20 21 |
# File 'lib/br_nfe/endereco.rb', line 19 def cep @cep end |
#codigo_ibge_uf ⇒ Object
Código IBGE do Estado (UF) Caso não seja setado um valor no atributo, irá pegar os primeiros 2 dígitos do código IBGE do município.
27 28 29 |
# File 'lib/br_nfe/endereco.rb', line 27 def codigo_ibge_uf @codigo_ibge_uf end |
#codigo_municipio ⇒ Object
IBGE
16 17 18 |
# File 'lib/br_nfe/endereco.rb', line 16 def codigo_municipio @codigo_municipio end |
#codigo_pais ⇒ Object
defaul: 1058 (Brasil)
20 21 22 |
# File 'lib/br_nfe/endereco.rb', line 20 def codigo_pais @codigo_pais end |
#complemento ⇒ Object
Returns the value of attribute complemento.
13 14 15 |
# File 'lib/br_nfe/endereco.rb', line 13 def complemento @complemento end |
#logradouro ⇒ Object
Returns the value of attribute logradouro.
11 12 13 |
# File 'lib/br_nfe/endereco.rb', line 11 def logradouro @logradouro end |
#nome_municipio ⇒ Object
Returns the value of attribute nome_municipio.
15 16 17 |
# File 'lib/br_nfe/endereco.rb', line 15 def nome_municipio @nome_municipio end |
#nome_pais ⇒ Object
defaul: BRASIL
21 22 23 |
# File 'lib/br_nfe/endereco.rb', line 21 def nome_pais @nome_pais end |
#numero ⇒ Object
Returns the value of attribute numero.
12 13 14 |
# File 'lib/br_nfe/endereco.rb', line 12 def numero @numero end |
#uf ⇒ Object
Returns the value of attribute uf.
17 18 19 |
# File 'lib/br_nfe/endereco.rb', line 17 def uf @uf end |
Instance Method Details
#default_values ⇒ Object
4 5 6 7 8 9 |
# File 'lib/br_nfe/endereco.rb', line 4 def default_values { codigo_pais: '1058', nome_pais: 'BRASIL' } end |
#exterior? ⇒ Boolean
60 61 62 |
# File 'lib/br_nfe/endereco.rb', line 60 def exterior? codigo_pais.to_i != 1058 end |
#is_present? ⇒ Boolean
34 35 36 37 38 |
# File 'lib/br_nfe/endereco.rb', line 34 def is_present? logradouro.present? || numero.present? || complemento.present? || bairro.present? || nome_municipio.present? || codigo_municipio.present? || cep.present? end |