paypal-csv-reports 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ccfba231de0384f143c54d1c2e82ffc2282e05c6
4
- data.tar.gz: 778faec4a474485514ff35d7189a325a8448e49c
3
+ metadata.gz: 475114aca4bffce24a70a0600cbeb4016bc661d4
4
+ data.tar.gz: c0e7684d9bf36c40be3bdaf13b1864d78cb6d2a9
5
5
  SHA512:
6
- metadata.gz: c8d15cd4979212f9ed502c3ad4c6e7ebb4202418a60cb0eff289626cf8831d1774a330f68c49caf76373b87ad3e3b84151cae71506cbe13bcb695e6db163b79f
7
- data.tar.gz: aeb07639ad6cc1d61cf9b07cc6702c529cfa8260eceba5fac3cdb45878e637c275eddd94931d10b95bb65ddd5ea3ea0614a02e7355d406f4dabfe68c53a6c64e
6
+ metadata.gz: 21472a93cc87c187dd1ae3e66b3009a4efbeb228c0a4257edb0e9c71040bbb4690c9ca8142ca6cd909595df84bf212ee55a9914445b47527a5c6fddc11d8f64d
7
+ data.tar.gz: 57c71f5a0769b7cdbb7901cec5ca1e50023cbd19549b81e810eb84617776d7bb0059a925a1b68e1da572358b9c29f8a8aed062c519aad6ebb812c51eeedee265
@@ -8,8 +8,7 @@ module Paypal
8
8
  new(File.open(file, 'r:bom|utf-8'))
9
9
  end
10
10
 
11
- attr_reader :header
12
- attr_reader :entries
11
+ attr_reader :generated_at, :reporting_window, :account_id, :version, :header, :entries
13
12
 
14
13
  def initialize(csv)
15
14
  @entries = []
@@ -27,6 +26,8 @@ module Paypal
27
26
  row_type = row.shift.to_s.strip
28
27
 
29
28
  case row_type
29
+ when 'RH'
30
+ parse_report_header(row)
30
31
  when 'CH'
31
32
  @header = parse_header(row)
32
33
  when 'SB'
@@ -34,6 +35,10 @@ module Paypal
34
35
  end
35
36
  end
36
37
 
38
+ def parse_report_header(row)
39
+ @generated_at, @reporting_window, @account_id, @version = row
40
+ end
41
+
37
42
  def parse_header(row)
38
43
  row.map { |v| v.downcase.gsub(' ', '_').to_sym }
39
44
  end
@@ -1,7 +1,7 @@
1
1
  module Paypal
2
2
  module Csv
3
3
  module Reports
4
- VERSION = '0.0.1'
4
+ VERSION = '0.0.2'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paypal-csv-reports
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Laurynas Butkus
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-26 00:00:00.000000000 Z
11
+ date: 2015-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler