Class: BrNfe::Endereco

Inherits:
ActiveModelBase show all
Defined in:
lib/br_nfe/endereco.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ActiveModelBase

#assign_attributes, #initialize

Constructor Details

This class inherits a constructor from BrNfe::ActiveModelBase

Instance Attribute Details

#bairroObject

Returns the value of attribute bairro.



14
15
16
# File 'lib/br_nfe/endereco.rb', line 14

def bairro
  @bairro
end

#cepObject

Returns the value of attribute cep.



18
19
20
# File 'lib/br_nfe/endereco.rb', line 18

def cep
  @cep
end

#codigo_municipioObject

IBGE



16
17
18
# File 'lib/br_nfe/endereco.rb', line 16

def codigo_municipio
  @codigo_municipio
end

#codigo_paisObject

defaul: 1058 (Brasil)



19
20
21
# File 'lib/br_nfe/endereco.rb', line 19

def codigo_pais
  @codigo_pais
end

#complementoObject

Returns the value of attribute complemento.



13
14
15
# File 'lib/br_nfe/endereco.rb', line 13

def complemento
  @complemento
end

#logradouroObject

Returns the value of attribute logradouro.



11
12
13
# File 'lib/br_nfe/endereco.rb', line 11

def logradouro
  @logradouro
end

#nome_municipioObject

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_paisObject

defaul: BRASIL



20
21
22
# File 'lib/br_nfe/endereco.rb', line 20

def nome_pais
  @nome_pais
end

#numeroObject

Returns the value of attribute numero.



12
13
14
# File 'lib/br_nfe/endereco.rb', line 12

def numero
  @numero
end

#ufObject

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_valuesObject



4
5
6
7
8
9
# File 'lib/br_nfe/endereco.rb', line 4

def default_values
	{
		codigo_pais: '1058',
		nome_pais: 'BRASIL'
	}
end

#is_present?Boolean

Returns:

  • (Boolean)


24
25
26
27
28
# File 'lib/br_nfe/endereco.rb', line 24

def is_present?
	logradouro.present? || numero.present? || complemento.present? || 
	bairro.present? || nome_municipio.present? || codigo_municipio.present? || 
	cep.present?
end