Class: NFe::EnderecoEmitente
- Inherits:
-
EntidadeNFe
- Object
- EntidadeNFe
- NFe::EnderecoEmitente
- Defined in:
- lib/nfe/entidades/infNFe/emit/endereco_emitente.rb
Instance Attribute Summary collapse
-
#CEP ⇒ Object
Returns the value of attribute CEP.
-
#cMun ⇒ Object
Returns the value of attribute cMun.
-
#cPais ⇒ Object
Returns the value of attribute cPais.
-
#fone ⇒ Object
Returns the value of attribute fone.
-
#nro ⇒ Object
Returns the value of attribute nro.
-
#UF ⇒ Object
Returns the value of attribute UF.
-
#xBairro ⇒ Object
Returns the value of attribute xBairro.
-
#xCpl ⇒ Object
Returns the value of attribute xCpl.
-
#xLgr ⇒ Object
Returns the value of attribute xLgr.
-
#xMun ⇒ Object
Returns the value of attribute xMun.
-
#xPais ⇒ Object
Returns the value of attribute xPais.
Instance Method Summary collapse
- #attributes ⇒ Object
- #attributes=(params) ⇒ Object
-
#initialize(attrs = {}) ⇒ EnderecoEmitente
constructor
A new instance of EnderecoEmitente.
-
#xml_to_hash(xml) ⇒ Object
node XML.
Methods inherited from EntidadeNFe
nfe_attr, #nfe_attributes, nfe_attrs, #serialize, #to_nfe, #to_nfe_xml, #to_xml, xml_accessor
Constructor Details
#initialize(attrs = {}) ⇒ EnderecoEmitente
Returns a new instance of EnderecoEmitente.
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/nfe/entidades/infNFe/emit/endereco_emitente.rb', line 17 def initialize(attrs = {}) self.xLgr = attrs[:xLgr] self.nro = attrs[:nro] self.xCpl = attrs[:xCpl] self.xBairro = attrs[:xBairro] self.cMun = attrs[:cMun] self.xMun = attrs[:xMun] self.UF = attrs[:UF] self.CEP = attrs[:CEP] self.cPais = attrs[:cPais] self.xPais = attrs[:xPais] self.fone = attrs[:fone] end |
Instance Attribute Details
#CEP ⇒ Object
Returns the value of attribute CEP.
12 13 14 |
# File 'lib/nfe/entidades/infNFe/emit/endereco_emitente.rb', line 12 def CEP @CEP end |
#cMun ⇒ Object
Returns the value of attribute cMun.
9 10 11 |
# File 'lib/nfe/entidades/infNFe/emit/endereco_emitente.rb', line 9 def cMun @cMun end |
#cPais ⇒ Object
Returns the value of attribute cPais.
13 14 15 |
# File 'lib/nfe/entidades/infNFe/emit/endereco_emitente.rb', line 13 def cPais @cPais end |
#fone ⇒ Object
Returns the value of attribute fone.
15 16 17 |
# File 'lib/nfe/entidades/infNFe/emit/endereco_emitente.rb', line 15 def fone @fone end |
#nro ⇒ Object
Returns the value of attribute nro.
6 7 8 |
# File 'lib/nfe/entidades/infNFe/emit/endereco_emitente.rb', line 6 def nro @nro end |
#UF ⇒ Object
Returns the value of attribute UF.
11 12 13 |
# File 'lib/nfe/entidades/infNFe/emit/endereco_emitente.rb', line 11 def UF @UF end |
#xBairro ⇒ Object
Returns the value of attribute xBairro.
8 9 10 |
# File 'lib/nfe/entidades/infNFe/emit/endereco_emitente.rb', line 8 def xBairro @xBairro end |
#xCpl ⇒ Object
Returns the value of attribute xCpl.
7 8 9 |
# File 'lib/nfe/entidades/infNFe/emit/endereco_emitente.rb', line 7 def xCpl @xCpl end |
#xLgr ⇒ Object
Returns the value of attribute xLgr.
5 6 7 |
# File 'lib/nfe/entidades/infNFe/emit/endereco_emitente.rb', line 5 def xLgr @xLgr end |
#xMun ⇒ Object
Returns the value of attribute xMun.
10 11 12 |
# File 'lib/nfe/entidades/infNFe/emit/endereco_emitente.rb', line 10 def xMun @xMun end |
#xPais ⇒ Object
Returns the value of attribute xPais.
14 15 16 |
# File 'lib/nfe/entidades/infNFe/emit/endereco_emitente.rb', line 14 def xPais @xPais end |
Instance Method Details
#attributes ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/nfe/entidades/infNFe/emit/endereco_emitente.rb', line 31 def attributes @attributes = { "xLgr" => xLgr, "nro" => nro, "xCpl" => xCpl, "xBairro" => xBairro, "cMun" => cMun, "xMun" => xMun, "UF" => UF, "CEP" => CEP, "cPais" => cPais, "xPais" => xPais, "fone" => fone } end |
#attributes=(params) ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/nfe/entidades/infNFe/emit/endereco_emitente.rb', line 47 def attributes=(params) self.xLgr = params[:xLgr], self.nro = params[:nro], self.xCpl = params[:xCpl], self.xBairro = params[:xBairro], self.cMun = params[:cMun], self.xMun = params[:xMun], self.UF = params[:UF], self.CEP = params[:CEP], self.cPais = params[:cPais], self.xPais = params[:xPais], self.fone = params[:fone] end |
#xml_to_hash(xml) ⇒ Object
node XML
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/nfe/entidades/infNFe/emit/endereco_emitente.rb', line 61 def xml_to_hash(xml) #node XML xml.children.css('enderEmit').each do |p| self.xLgr = p.css('xLgr').text self.nro = p.css('nro').text self.xCpl = p.css('xCpl').text self.xBairro = p.css('xBairro').text self.cMun = p.css('cMun').text self.xMun = p.css('xMun').text self.UF = p.css('UF').text self.CEP = p.css('CEP').text self.cPais = p.css('cPais').text self.xPais = p.css('xPais').text self.fone = p.css('fone').text end self end |