Class: Nfe::Reader::Cane
- Inherits:
-
Object
- Object
- Nfe::Reader::Cane
- Includes:
- AttributeHelper, CreatorHelper
- Defined in:
- lib/nfe_reader/product/cane.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#days ⇒ Object
readonly
Returns the value of attribute days.
-
#deduction_value ⇒ Object
readonly
Returns the value of attribute deduction_value.
-
#deductions ⇒ Object
readonly
Returns the value of attribute deductions.
-
#harvest ⇒ Object
readonly
Returns the value of attribute harvest.
-
#month ⇒ Object
readonly
Returns the value of attribute month.
-
#month_amount ⇒ Object
readonly
Returns the value of attribute month_amount.
-
#net_value ⇒ Object
readonly
Returns the value of attribute net_value.
-
#previous_amount ⇒ Object
readonly
Returns the value of attribute previous_amount.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Cane
constructor
A new instance of Cane.
Methods included from CreatorHelper
#create_resource, #create_resources, #to_array
Methods included from AttributeHelper
#attributes, #attributes_to_hash
Constructor Details
#initialize(attrs = {}) ⇒ Cane
Returns a new instance of Cane.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/nfe_reader/product/cane.rb', line 10 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 |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
7 8 9 |
# File 'lib/nfe_reader/product/cane.rb', line 7 def amount @amount end |
#days ⇒ Object (readonly)
Returns the value of attribute days.
7 8 9 |
# File 'lib/nfe_reader/product/cane.rb', line 7 def days @days end |
#deduction_value ⇒ Object (readonly)
Returns the value of attribute deduction_value.
7 8 9 |
# File 'lib/nfe_reader/product/cane.rb', line 7 def deduction_value @deduction_value end |
#deductions ⇒ Object (readonly)
Returns the value of attribute deductions.
7 8 9 |
# File 'lib/nfe_reader/product/cane.rb', line 7 def deductions @deductions end |
#harvest ⇒ Object (readonly)
Returns the value of attribute harvest.
7 8 9 |
# File 'lib/nfe_reader/product/cane.rb', line 7 def harvest @harvest end |
#month ⇒ Object (readonly)
Returns the value of attribute month.
7 8 9 |
# File 'lib/nfe_reader/product/cane.rb', line 7 def month @month end |
#month_amount ⇒ Object (readonly)
Returns the value of attribute month_amount.
7 8 9 |
# File 'lib/nfe_reader/product/cane.rb', line 7 def month_amount @month_amount end |
#net_value ⇒ Object (readonly)
Returns the value of attribute net_value.
7 8 9 |
# File 'lib/nfe_reader/product/cane.rb', line 7 def net_value @net_value end |
#previous_amount ⇒ Object (readonly)
Returns the value of attribute previous_amount.
7 8 9 |
# File 'lib/nfe_reader/product/cane.rb', line 7 def previous_amount @previous_amount end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
7 8 9 |
# File 'lib/nfe_reader/product/cane.rb', line 7 def value @value end |