Class: Konfig::ConfigProvider
- Inherits:
-
Object
- Object
- Konfig::ConfigProvider
- Defined in:
- lib/konfig/config_provider.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#workdir ⇒ Object
readonly
Returns the value of attribute workdir.
Instance Method Summary collapse
-
#initialize(mode:, workdir:) ⇒ ConfigProvider
constructor
A new instance of ConfigProvider.
Constructor Details
#initialize(mode:, workdir:) ⇒ ConfigProvider
Returns a new instance of ConfigProvider.
6 7 8 9 10 11 12 13 |
# File 'lib/konfig/config_provider.rb', line 6 def initialize(mode:, workdir:) raise ArgumentError unless workdir raise ArgumentError unless [:yaml, :directory].include? mode raise FileNotFound, "directory #{workdir} not found" unless Dir.exist? workdir @mode = mode @workdir = workdir end |
Instance Attribute Details
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
3 4 5 |
# File 'lib/konfig/config_provider.rb', line 3 def mode @mode end |
#workdir ⇒ Object (readonly)
Returns the value of attribute workdir.
4 5 6 |
# File 'lib/konfig/config_provider.rb', line 4 def workdir @workdir end |