sepa_clearer 0.2.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Binary file
@@ -28,6 +28,10 @@ module SepaClearer
28
28
  end.first
29
29
  end
30
30
 
31
+ def delete
32
+ db.execute("DELETE FROM payment_providers").first
33
+ end
34
+
31
35
  def normalize_bic(bic)
32
36
  bic.to_s.ljust(11, 'X').upcase
33
37
  end
@@ -12,8 +12,8 @@ module SepaClearer
12
12
  def data(file = nil)
13
13
  @data ||= begin
14
14
  [].tap do |data|
15
- CSV.foreach(file || default_data_file, { headers: true, col_sep: ';', header_converters: :symbol }) do |row|
16
- data.push PaymentProvider.new(*parse_raw_data(row))
15
+ CSV.foreach(file || default_data_file, { headers: true, col_sep: ';', header_converters: :symbol, encoding: "iso-8859-1:UTF-8" }) do |row|
16
+ data.push PaymentProvider.new(parse_raw_data(row))
17
17
  end
18
18
  end
19
19
  end
@@ -24,6 +24,14 @@ module SepaClearer
24
24
  (capabilities & [:core, :cor1]).sort
25
25
  end
26
26
 
27
+ def bic
28
+ @bic.to_s.ljust(11, 'X').upcase
29
+ end
30
+
31
+ def to_a
32
+ to_hash.values
33
+ end
34
+
27
35
  def to_hash
28
36
  {
29
37
  name: name,
@@ -1,3 +1,3 @@
1
1
  module SepaClearer
2
- VERSION = '0.2.0'
2
+ VERSION = '0.4.0'
3
3
  end
@@ -9,7 +9,7 @@ describe SepaClearer::Clearer do
9
9
 
10
10
  describe '#find_by_bic' do
11
11
  it 'returns the provider with the given BIC' do
12
- expect(subject.find_by_bic('AABAFI22TMS')).to be_kind_of(SepaClearer::PaymentProvider)
12
+ expect(subject.find_by_bic('AABAFI22')).to be_kind_of(SepaClearer::PaymentProvider)
13
13
  end
14
14
 
15
15
  it 'returns nil if no object matches the BIC' do
@@ -23,7 +23,7 @@ describe SepaClearer::Clearer do
23
23
  end
24
24
 
25
25
  it 'returns an initialize object' do
26
- expect(subject.find_by_bic('AABAFI22TMS').name).to eq('BANK OF ALAND PLC')
26
+ expect(subject.find_by_bic('AABAFI22').name).to eq('BANK OF ALAND PLC')
27
27
  end
28
28
  end
29
29
 
@@ -52,7 +52,7 @@ describe SepaClearer::PaymentProvider do
52
52
  it 'sets correct values' do
53
53
  expect(provider.to_hash).to match({
54
54
  name: 'test',
55
- bic: 'bic',
55
+ bic: 'BICXXXXXXXX',
56
56
  sct: true,
57
57
  core: false,
58
58
  cor1: true,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sepa_clearer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maximilian Schulz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-24 00:00:00.000000000 Z
11
+ date: 2016-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sqlite3
@@ -114,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
114
  version: '0'
115
115
  requirements: []
116
116
  rubyforge_project:
117
- rubygems_version: 2.2.2
117
+ rubygems_version: 2.5.1
118
118
  signing_key:
119
119
  specification_version: 4
120
120
  summary: List of all available SEPA clearers and their supported features
@@ -123,4 +123,3 @@ test_files:
123
123
  - spec/deutsche_bundesbank_spec.rb
124
124
  - spec/payment_provider_spec.rb
125
125
  - spec/spec_helper.rb
126
- has_rdoc: