Total Complexity | 4 |
Total Lines | 23 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | # frozen_string_literal: true |
||
4 | class Configuration |
||
5 | attr_accessor :iban_meta_path, :use_static_bics, :static_bics_path, :bics_table_name |
||
6 | |||
7 | def country_validators |
||
8 | @country_validators ||= {} |
||
9 | end |
||
10 | |||
11 | def add(country) |
||
12 | country_validators[country] = Proc.new |
||
13 | end |
||
14 | |||
15 | def static_bics |
||
16 | @static_bics ||= begin |
||
17 | Hash[Dir.glob(File.join(static_bics_path, "*.yml")).map do |file| |
||
18 | [File.basename(file).delete(".yml").upcase, YAML.load_file(file)] |
||
19 | end].freeze |
||
20 | end |
||
21 | end |
||
22 | |||
23 | def static_bics? |
||
24 | use_static_bics |
||
25 | end |
||
26 | end |
||
27 | end |
||
28 |