Class: NfeReader::Exportation

Inherits:
Object
  • Object
show all
Includes:
AttributeHelper
Defined in:
lib/nfe_reader/product/exportation.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 = {}) ⇒ Exportation

Returns a new instance of Exportation.



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

def initialize(attrs = {})
  # Número do ato concessório de Drawback
  @drawnback = attrs[:nDraw]
  
  if attrs[:exportInd]
    # Número do Registro de Exportação
    @number = attrs[:exportInd][:nRE]
    # Chave de Acesso da NF-e recebida para exportação
    @key = attrs[:exportInd][:chNFe]
    # Quantidade do item realmente exportado
    @amount= attrs[:exportInd][:qExport]
  end
end

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount.



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

def amount
  @amount
end

#drawnbackObject (readonly)

Returns the value of attribute drawnback.



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

def drawnback
  @drawnback
end

#keyObject (readonly)

Returns the value of attribute key.



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

def key
  @key
end

#numberObject (readonly)

Returns the value of attribute number.



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

def number
  @number
end