Class: NfeReader::Fuel

Inherits:
Object
  • Object
show all
Includes:
AttributeHelper
Defined in:
lib/nfe_reader/product/fuel.rb

Constant Summary

Constants included from AttributeHelper

AttributeHelper::WITHELIST

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from AttributeHelper

#attributes, #attributes_to_hash

Constructor Details

#initialize(attrs = {}) ⇒ Fuel

Returns a new instance of Fuel.



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/nfe_reader/product/fuel.rb', line 8

def initialize(attrs = {})
  @anp = attrs[:cProdANP]
  @codif = attrs[:CODIF]
  @amount = attrs[:qTemp]
  
  if attrs[:CIDE]
    @cide_base = attrs[:CIDE][:qBCprod]
    @cide_aliquot = attrs[:CIDE][:vAliqProd]
    @cide_value = attrs[:CIDE][:vCIDE]
  end
end

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount.



6
7
8
# File 'lib/nfe_reader/product/fuel.rb', line 6

def amount
  @amount
end

#anpObject (readonly)

Returns the value of attribute anp.



6
7
8
# File 'lib/nfe_reader/product/fuel.rb', line 6

def anp
  @anp
end

#cide_aliquotObject (readonly)

Returns the value of attribute cide_aliquot.



6
7
8
# File 'lib/nfe_reader/product/fuel.rb', line 6

def cide_aliquot
  @cide_aliquot
end

#cide_baseObject (readonly)

Returns the value of attribute cide_base.



6
7
8
# File 'lib/nfe_reader/product/fuel.rb', line 6

def cide_base
  @cide_base
end

#cide_valueObject (readonly)

Returns the value of attribute cide_value.



6
7
8
# File 'lib/nfe_reader/product/fuel.rb', line 6

def cide_value
  @cide_value
end

#codifObject (readonly)

Returns the value of attribute codif.



6
7
8
# File 'lib/nfe_reader/product/fuel.rb', line 6

def codif
  @codif
end