Module: Dragonfly::Configurable::ClassMethods
- Defined in:
- lib/dragonfly/configurable.rb
Instance Method Summary (collapse)
- - (Object) config_methods
- - (Object) configurable_ancestors
- - (Object) default_configuration
- - (Object) nested_configurables
- - (Object) register_configuration(name, config = nil, &config_in_block)
- - (Object) saved_configs
Instance Method Details
- (Object) config_methods
121 122 123 124 125 126 |
# File 'lib/dragonfly/configurable.rb', line 121 def config_methods @config_methods ||= configurable_ancestors.inject([]) do |conf_methods, klass| conf_methods |= klass.config_methods conf_methods end end |
- (Object) configurable_ancestors
140 141 142 |
# File 'lib/dragonfly/configurable.rb', line 140 def configurable_ancestors @configurable_ancestors ||= ancestors.select{|a| a.included_modules.include?(Configurable) } - [self] end |
- (Object) default_configuration
114 115 116 117 118 119 |
# File 'lib/dragonfly/configurable.rb', line 114 def default_configuration @default_configuration ||= configurable_ancestors.reverse.inject({}) do |default_config, klass| default_config.merge!(klass.default_configuration) default_config end end |
- (Object) nested_configurables
128 129 130 |
# File 'lib/dragonfly/configurable.rb', line 128 def nested_configurables @nested_configurables ||= [] end |
- (Object) register_configuration(name, config = nil, &config_in_block)
132 133 134 |
# File 'lib/dragonfly/configurable.rb', line 132 def register_configuration(name, config=nil, &config_in_block) saved_configs[name] = config_in_block || config end |
- (Object) saved_configs
136 137 138 |
# File 'lib/dragonfly/configurable.rb', line 136 def saved_configs @saved_configs ||= {} end |