Class: NfeReader::Billing

Inherits:
Object
  • Object
show all
Includes:
AttributeHelper, CreatorHelper
Defined in:
lib/nfe_reader/billing.rb

Overview

Mapeia as Cobrancas

Constant Summary

Constants included from AttributeHelper

AttributeHelper::WITHELIST

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from CreatorHelper

#create_resource, #create_resources, #to_array

Methods included from AttributeHelper

#attributes, #attributes_to_hash

Constructor Details

#initialize(attrs = {}) ⇒ Billing



10
11
12
13
14
15
16
17
18
19
# File 'lib/nfe_reader/billing.rb', line 10

def initialize(attrs = {})
  if attrs[:fat]
    @number = attrs[:fat][:nFat]
    @value = attrs[:fat][:vOrig]
    @descount = attrs[:fat][:vDesc]
    @value_net = attrs[:fat][:vLiq]
  end

  @duplicates = create_resources(Duplicate, attrs[:dup])
end

Instance Attribute Details

#descountObject (readonly)

Returns the value of attribute descount.



8
9
10
# File 'lib/nfe_reader/billing.rb', line 8

def descount
  @descount
end

#duplicatesObject (readonly)

Returns the value of attribute duplicates.



8
9
10
# File 'lib/nfe_reader/billing.rb', line 8

def duplicates
  @duplicates
end

#numberObject (readonly)

Returns the value of attribute number.



8
9
10
# File 'lib/nfe_reader/billing.rb', line 8

def number
  @number
end

#valueObject (readonly)

Returns the value of attribute value.



8
9
10
# File 'lib/nfe_reader/billing.rb', line 8

def value
  @value
end

#value_netObject (readonly)

Returns the value of attribute value_net.



8
9
10
# File 'lib/nfe_reader/billing.rb', line 8

def value_net
  @value_net
end