Class: RubyXmlNfe::Pis

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml, params) ⇒ Pis

Returns a new instance of Pis.



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

def initialize(xml, params)
  @xml = xml
  @pis_aliq_params = params[:PISAliq]
  @pis_outr_params = params[:PISOutr]
end

Instance Attribute Details

#pis_aliq_paramsObject (readonly)

Returns the value of attribute pis_aliq_params.



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

def pis_aliq_params
  @pis_aliq_params
end

#pis_outr_paramsObject (readonly)

Returns the value of attribute pis_outr_params.



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

def pis_outr_params
  @pis_outr_params
end

#xmlObject (readonly)

Returns the value of attribute xml.



6
7
8
# File 'lib/ruby_xml_nfe/pis.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/pis.rb', line 14

def build
  xml.PIS do
    if pis_aliq_params
      pis_aliq = RubyXmlNfe::PisAliq.new(xml, pis_aliq_params)
      pis_aliq.build
    end

    if pis_outr_params
      pis_outr = RubyXmlNfe::PisOutr.new(xml, pis_outr_params)
      pis_outr.build
    end
  end
end