Class: LoadableConfig::Options
- Inherits:
-
Object
- Object
- LoadableConfig::Options
- Defined in:
- lib/loadable_config/options.rb
Instance Attribute Summary collapse
-
#config_path_prefix ⇒ Object
Returns the value of attribute config_path_prefix.
-
#environment_key ⇒ Object
Returns the value of attribute environment_key.
-
#preprocessor ⇒ Object
readonly
Returns the value of attribute preprocessor.
Instance Method Summary collapse
-
#initialize ⇒ Options
constructor
A new instance of Options.
- #preprocess(&block) ⇒ Object
Constructor Details
#initialize ⇒ Options
Returns a new instance of Options.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/loadable_config/options.rb', line 6 def initialize # Prefix for configuration file paths. Must be a valid directory, for # example `Rails.root`. If unset, configuration files are resolved relative # to the current working directory. @config_path_prefix = nil # If set, assumes that all LoadableConfig configuration files are structured # with top-level keys specifying different environments, each of which is a # hash of the configuration attributes. Setting this specifies which top # level key to select. For example, `Rails.env`. @environment_key = nil # If set, uses the provided block to preprocess the configuration file # before YAML parsing. @preprocessor = nil end |
Instance Attribute Details
#config_path_prefix ⇒ Object
Returns the value of attribute config_path_prefix.
4 5 6 |
# File 'lib/loadable_config/options.rb', line 4 def config_path_prefix @config_path_prefix end |
#environment_key ⇒ Object
Returns the value of attribute environment_key.
4 5 6 |
# File 'lib/loadable_config/options.rb', line 4 def environment_key @environment_key end |
#preprocessor ⇒ Object (readonly)
Returns the value of attribute preprocessor.
4 5 6 |
# File 'lib/loadable_config/options.rb', line 4 def preprocessor @preprocessor end |
Instance Method Details
#preprocess(&block) ⇒ Object
35 36 37 |
# File 'lib/loadable_config/options.rb', line 35 def preprocess(&block) @preprocessor = block end |