class NfeReader::Cane

Attributes

amount[R]
days[R]
deduction_value[R]
deductions[R]
harvest[R]
month[R]
month_amount[R]
net_value[R]
previous_amount[R]
value[R]

Public Class Methods

new(attrs = {}) click to toggle source
# File lib/nfe_reader/product/cane.rb, line 9
def initialize(attrs = {})
  @harvest = attrs[:safra]
  @month = attrs[:ref]
  @month_amount = attrs[:qTotMes]
  @previous_amount = attrs[:qTotAnt]
  @amount = attrs[:qTotGer]
  @value = attrs[:vFor]
  @deduction_value = attrs[:vTotDed]
  @net_value = attrs[:vLiqFor]

  @days = []
  
  if attrs[:forDia]
    @days = to_array(attrs[:forDia])
  end

  if attrs[:deduc]
    @deductions = to_array(attrs[:deduc])
  end
end