Class: RubyXmlNfe::Cobr

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml, params) ⇒ Cobr

Returns a new instance of Cobr.



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

def initialize(xml, params)
  @xml = xml
  @fat_params = params[:fat]
  @tag_dup = params[:dup]
end

Instance Attribute Details

#fat_paramsObject (readonly)

Returns the value of attribute fat_params.



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

def fat_params
  @fat_params
end

#tag_dupObject (readonly)

Returns the value of attribute tag_dup.



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

def tag_dup
  @tag_dup
end

#xmlObject (readonly)

Returns the value of attribute xml.



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

def xml
  @xml
end

Instance Method Details

#buildObject



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

def build
  xml.cobr do
    fat = RubyXmlNfe::Fat.new(xml, fat_params)
    fat.build

    tag_dup.map do |dup_params|
      _dup = RubyXmlNfe::Dup.new(xml, dup_params)
      _dup.build
    end
  end
end