Class: RubyXmlNfe::Vol

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(xml, params) ⇒ Vol

Returns a new instance of Vol.



4
5
6
7
8
9
10
# File 'lib/ruby_xml_nfe/vol.rb', line 4

def initialize(xml, params)
  @xml = xml
  @qVol = params[:qVol]
  @esp = params[:esp]
  @pesoL = params[:pesoL]
  @pesoB = params[:pesoB]
end

Instance Attribute Details

#espObject (readonly)

Returns the value of attribute esp.



3
4
5
# File 'lib/ruby_xml_nfe/vol.rb', line 3

def esp
  @esp
end

#pesoBObject (readonly)

Returns the value of attribute pesoB.



3
4
5
# File 'lib/ruby_xml_nfe/vol.rb', line 3

def pesoB
  @pesoB
end

#pesoLObject (readonly)

Returns the value of attribute pesoL.



3
4
5
# File 'lib/ruby_xml_nfe/vol.rb', line 3

def pesoL
  @pesoL
end

#qVolObject (readonly)

Returns the value of attribute qVol.



3
4
5
# File 'lib/ruby_xml_nfe/vol.rb', line 3

def qVol
  @qVol
end

#xmlObject (readonly)

Returns the value of attribute xml.



3
4
5
# File 'lib/ruby_xml_nfe/vol.rb', line 3

def xml
  @xml
end

Instance Method Details

#buildObject



12
13
14
15
16
17
18
19
# File 'lib/ruby_xml_nfe/vol.rb', line 12

def build
  xml.vol do
    xml.qVol qVol if qVol
    xml.esp esp if esp
    xml.pesoL pesoL
    xml.pesoB pesoB
  end
end