Class: Hotfile::Record::BCT95

Inherits:
Hotfile::Record show all
Defined in:
lib/hotfile/record/BCT95.rb

Overview

Billing Analysis (Cycle) Totals per Currency Type Record

Instance Method Summary collapse

Constructor Details

#initialize(line) ⇒ BCT95

Returns a new instance of BCT95.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/hotfile/record/BCT95.rb', line 7

def initialize(line)
  super

  processing_date_id, cycle_id, office_count, gross, remittance, commission, tax, commission_tax, reserved,
      currency =
    line.scan(/
      ([A-Z0-9 ]{3})
      (\d)
      (\d{5})
      (\d{14}.)
      (\d{14}.)
      (\d{14}.)
      (\d{14}.)
      (\d{14}.)
      (.{35})
      ([A-Z0-9]{4})
    /x).flatten

  @data = {
    currency: currency.strip,
    processing: { date: processing_date_id.strip, cycle: cycle_id.to_i },
    office_count: Hotfile::Integer.new(office_count).to_i,
    gross: Hotfile::Integer.new(gross).to_i,
    remittance: Hotfile::Integer.new(remittance).to_i,
    commission: Hotfile::Integer.new(commission).to_i,
    tax: Hotfile::Integer.new(tax).to_i,
    commission_tax: Hotfile::Integer.new(commission_tax).to_i,
    reserved: reserved.strip
  }
end