Class: Konfig::DirectoryProvider
- Inherits:
-
ConfigProvider
- Object
- ConfigProvider
- Konfig::DirectoryProvider
- Defined in:
- lib/konfig/directory_provider.rb
Instance Attribute Summary
Attributes inherited from ConfigProvider
Instance Method Summary collapse
-
#initialize(workdir:) ⇒ DirectoryProvider
constructor
A new instance of DirectoryProvider.
- #load ⇒ Object
Constructor Details
#initialize(workdir:) ⇒ DirectoryProvider
Returns a new instance of DirectoryProvider.
6 7 8 9 10 11 |
# File 'lib/konfig/directory_provider.rb', line 6 def initialize(workdir:) super(mode: :yaml, workdir: workdir) @files = Dir.children(@workdir) # exclude any directories there @files = @files.delete_if { |x| File.directory?(File.join(@workdir, x)) } end |
Instance Method Details
#load ⇒ Object
13 14 15 16 |
# File 'lib/konfig/directory_provider.rb', line 13 def load Konfig.configuration.logger.info "Loading files from #{@workdir}" build_object_from_list(@files) end |