Module: Confix::RootInstanceMethods
- Defined in:
- lib/confix.rb
Overview
Root instance methods
Instance Attribute Summary collapse
-
#assigns ⇒ Hash
readonly
Assignment variables.
Instance Method Summary collapse
-
#child? ⇒ Boolean
Determines whether this configuration is a child configuration.
-
#config_root ⇒ Object
Gets the config root (this object).
-
#configs ⇒ Object
Gets a hash containing intermediate configuration objects.
- #fetch(name, default) ⇒ Object
-
#values ⇒ Object
Gets all configuration values.
Instance Attribute Details
#assigns ⇒ Hash (readonly)
Returns Assignment variables. These are available as interpolation arguments in any string setting. You can modify this hash.
112 113 114 |
# File 'lib/confix.rb', line 112 def assigns @assigns ||= {} end |
Instance Method Details
#child? ⇒ Boolean
Determines whether this configuration is a child configuration.
117 118 119 |
# File 'lib/confix.rb', line 117 def child? false end |
#config_root ⇒ Object
Gets the config root (this object).
129 130 131 |
# File 'lib/confix.rb', line 129 def config_root self end |
#configs ⇒ Object
Gets a hash containing intermediate configuration objects.
139 140 141 |
# File 'lib/confix.rb', line 139 def configs @configs ||= {} end |
#fetch(name, default) ⇒ Object
121 122 123 124 125 126 |
# File 'lib/confix.rb', line 121 def fetch(name, default) value = values[name] value = default if value.nil? value = value % assigns if value.is_a?(String) value end |
#values ⇒ Object
Gets all configuration values.
134 135 136 |
# File 'lib/confix.rb', line 134 def values @values ||= {} end |