Class: AutoDecorator::Loader

Inherits:
Object
  • Object
show all
Defined in:
lib/auto_decorator/loader.rb

Class Method Summary collapse

Class Method Details

.call(base_path:, suffix: "Decorator") ⇒ Object



7
8
9
10
11
12
# File 'lib/auto_decorator/loader.rb', line 7

def self.call(base_path:, suffix: "Decorator")
  base = Pathname.new(base_path)
  Dir.glob(base.join("**/*_#{suffix.downcase}.rb")).each do |file|
    load_file(file, base, suffix)
  end
end