Class: Moltrio::Config::SingleFileAdapter
- Defined in:
- lib/moltrio/config/adapters/single_file_adapter.rb
Instance Attribute Summary collapse
-
#must_exist ⇒ Object
readonly
Returns the value of attribute must_exist.
Instance Method Summary collapse
-
#initialize(config, path, must_exist: false) ⇒ SingleFileAdapter
constructor
A new instance of SingleFileAdapter.
- #missing_namespace? ⇒ Boolean
Methods inherited from Adapter
#[], #[]=, #available_namespaces, #fetch, #fetch_all, #has_key?, #on_namespace, #slice
Constructor Details
#initialize(config, path, must_exist: false) ⇒ SingleFileAdapter
Returns a new instance of SingleFileAdapter.
13 14 15 16 17 18 19 |
# File 'lib/moltrio/config/adapters/single_file_adapter.rb', line 13 def initialize(config, path, must_exist: false) @path = path if must_exist && !Pathname(path).file? raise "File '#{path}' doesn't exist!" end end |
Instance Attribute Details
#must_exist ⇒ Object (readonly)
Returns the value of attribute must_exist.
12 13 14 |
# File 'lib/moltrio/config/adapters/single_file_adapter.rb', line 12 def must_exist @must_exist end |
Instance Method Details
#missing_namespace? ⇒ Boolean
21 22 23 |
# File 'lib/moltrio/config/adapters/single_file_adapter.rb', line 21 def missing_namespace? false end |