Class: BanksRegistry::Loaders::RulesLoader
- Inherits:
-
Object
- Object
- BanksRegistry::Loaders::RulesLoader
- Defined in:
- lib/banks_registry/loaders/rules_loader.rb
Constant Summary collapse
- RULES_FOLDER =
'data/rules'
Instance Method Summary collapse
- #call(code) ⇒ Object
-
#initialize ⇒ RulesLoader
constructor
A new instance of RulesLoader.
Constructor Details
#initialize ⇒ RulesLoader
11 12 13 |
# File 'lib/banks_registry/loaders/rules_loader.rb', line 11 def initialize @cache = {} end |
Instance Method Details
#call(code) ⇒ Object
15 16 17 18 19 |
# File 'lib/banks_registry/loaders/rules_loader.rb', line 15 def call(code) return @cache[code] if @cache.key?(code) @cache[code] = Models::Rule.new(load_rule_yml(code)) end |