Class: RubyXmlNfe::EnderDest

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_xml_nfe/ender_dest.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml, params) ⇒ EnderDest

Returns a new instance of EnderDest.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/ruby_xml_nfe/ender_dest.rb', line 8

def initialize(xml, params)
  @xml = xml
  @xLgr = params[:xLgr]
  @nro = params[:nro]
  @xCpl = params[:xCpl]
  @xBairro = params[:xBairro]
  @cMun = params[:cMun]
  @xMun = params[:xMun]
  @uf = params[:UF]
  @cep = params[:CEP]
  @cPais = params[:cPais]
  @xPais = params[:xPais]
  @fone = params[:fone]
end

Instance Attribute Details

#cepObject

Returns the value of attribute cep.



5
6
7
# File 'lib/ruby_xml_nfe/ender_dest.rb', line 5

def cep
  @cep
end

#cMunObject

Returns the value of attribute cMun.



5
6
7
# File 'lib/ruby_xml_nfe/ender_dest.rb', line 5

def cMun
  @cMun
end

#cPaisObject

Returns the value of attribute cPais.



5
6
7
# File 'lib/ruby_xml_nfe/ender_dest.rb', line 5

def cPais
  @cPais
end

#foneObject

Returns the value of attribute fone.



5
6
7
# File 'lib/ruby_xml_nfe/ender_dest.rb', line 5

def fone
  @fone
end

#nroObject

Returns the value of attribute nro.



5
6
7
# File 'lib/ruby_xml_nfe/ender_dest.rb', line 5

def nro
  @nro
end

#ufObject

Returns the value of attribute uf.



5
6
7
# File 'lib/ruby_xml_nfe/ender_dest.rb', line 5

def uf
  @uf
end

#xBairroObject

Returns the value of attribute xBairro.



5
6
7
# File 'lib/ruby_xml_nfe/ender_dest.rb', line 5

def xBairro
  @xBairro
end

#xCplObject

Returns the value of attribute xCpl.



5
6
7
# File 'lib/ruby_xml_nfe/ender_dest.rb', line 5

def xCpl
  @xCpl
end

#xLgrObject

Returns the value of attribute xLgr.



5
6
7
# File 'lib/ruby_xml_nfe/ender_dest.rb', line 5

def xLgr
  @xLgr
end

#xmlObject

Returns the value of attribute xml.



5
6
7
# File 'lib/ruby_xml_nfe/ender_dest.rb', line 5

def xml
  @xml
end

#xMunObject

Returns the value of attribute xMun.



5
6
7
# File 'lib/ruby_xml_nfe/ender_dest.rb', line 5

def xMun
  @xMun
end

#xPaisObject

Returns the value of attribute xPais.



5
6
7
# File 'lib/ruby_xml_nfe/ender_dest.rb', line 5

def xPais
  @xPais
end

Instance Method Details

#buildObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/ruby_xml_nfe/ender_dest.rb', line 23

def build
  xml.enderDest do
    xml.xLgr xLgr
    xml.nro nro
    xml.xCpl xCpl if xCpl
    xml.xBairro xBairro
    xml.cMun cMun
    xml.xMun xMun
    xml.UF uf
    xml.CEP cep
    xml.cPais cPais
    xml.xPais xPais
    xml.fone fone if fone
  end
end