Class: Aoororachain::Loaders::DirectoryLoader
- Inherits:
-
Object
- Object
- Aoororachain::Loaders::DirectoryLoader
- Defined in:
- lib/aoororachain/loaders/directory_loader.rb
Instance Method Summary collapse
-
#initialize(path:, glob:, loader:, parser: nil) ⇒ DirectoryLoader
constructor
A new instance of DirectoryLoader.
- #load ⇒ Object
Constructor Details
#initialize(path:, glob:, loader:, parser: nil) ⇒ DirectoryLoader
Returns a new instance of DirectoryLoader.
6 7 8 9 10 11 |
# File 'lib/aoororachain/loaders/directory_loader.rb', line 6 def initialize(path:, glob:, loader:, parser: nil) @path = path @glob = glob @loader = loader @parser = parser end |
Instance Method Details
#load ⇒ Object
13 14 15 |
# File 'lib/aoororachain/loaders/directory_loader.rb', line 13 def load Dir.glob("#{@path}/#{@glob}").map { |file| @loader.load(file, parser: @parser) } end |