Class: RubyXmlNfe::Cofins

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml, params) ⇒ Cofins

Returns a new instance of Cofins.



8
9
10
11
12
# File 'lib/ruby_xml_nfe/cofins.rb', line 8

def initialize(xml, params)
  @xml = xml
  @cofins_aliq_params = params[:COFINSAliq]
  @cofins_outr_params = params[:COFINSOutr]
end

Instance Attribute Details

#cofins_aliq_paramsObject (readonly)

Returns the value of attribute cofins_aliq_params.



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

def cofins_aliq_params
  @cofins_aliq_params
end

#cofins_outr_paramsObject (readonly)

Returns the value of attribute cofins_outr_params.



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

def cofins_outr_params
  @cofins_outr_params
end

#xmlObject (readonly)

Returns the value of attribute xml.



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

def xml
  @xml
end

Instance Method Details

#buildObject



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/ruby_xml_nfe/cofins.rb', line 14

def build
  xml.COFINS do
    if cofins_aliq_params
      cofins_aliq = RubyXmlNfe::CofinsAliq.new(xml, cofins_aliq_params)
      cofins_aliq.build
    end

    if cofins_outr_params
      cofins_outr = RubyXmlNfe::CofinsOutr.new(xml, cofins_outr_params)
      cofins_outr.build
    end
  end
end