Class: RubyXmlNfe::Dest

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml, params) ⇒ Dest

Returns a new instance of Dest.



8
9
10
11
12
13
14
15
16
# File 'lib/ruby_xml_nfe/dest.rb', line 8

def initialize(xml, params)
  @xml = xml
  @cnpj = params[:CNPJ]
  @xNome = params[:xNome]
  @ender_dest_params = params[:enderDest]
  @indIEDest = params[:indIEDest]
  @ie = params[:IE]
  @email = params[:email]
end

Instance Attribute Details

#cnpjObject (readonly)

Returns the value of attribute cnpj.



6
7
8
# File 'lib/ruby_xml_nfe/dest.rb', line 6

def cnpj
  @cnpj
end

#emailObject (readonly)

Returns the value of attribute email.



6
7
8
# File 'lib/ruby_xml_nfe/dest.rb', line 6

def email
  @email
end

#ender_dest_paramsObject (readonly)

Returns the value of attribute ender_dest_params.



6
7
8
# File 'lib/ruby_xml_nfe/dest.rb', line 6

def ender_dest_params
  @ender_dest_params
end

#ieObject (readonly)

Returns the value of attribute ie.



6
7
8
# File 'lib/ruby_xml_nfe/dest.rb', line 6

def ie
  @ie
end

#indIEDestObject (readonly)

Returns the value of attribute indIEDest.



6
7
8
# File 'lib/ruby_xml_nfe/dest.rb', line 6

def indIEDest
  @indIEDest
end

#xmlObject (readonly)

Returns the value of attribute xml.



6
7
8
# File 'lib/ruby_xml_nfe/dest.rb', line 6

def xml
  @xml
end

#xNomeObject (readonly)

Returns the value of attribute xNome.



6
7
8
# File 'lib/ruby_xml_nfe/dest.rb', line 6

def xNome
  @xNome
end

Instance Method Details

#buildObject



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/ruby_xml_nfe/dest.rb', line 18

def build
  xml.dest do
    xml.CNPJ cnpj
    xml.xNome xNome

    ender_emit = RubyXmlNfe::EnderDest.new(xml, ender_dest_params)
    ender_emit.build

    xml.indIEDest indIEDest
    xml.IE ie if ie
    xml.email email if email
  end
end