Class: LoadableConfig::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/loadable_config/options.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeOptions

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_prefixObject

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_keyObject

Returns the value of attribute environment_key.



4
5
6
# File 'lib/loadable_config/options.rb', line 4

def environment_key
  @environment_key
end

#preprocessorObject (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