Module: Dragonfly::Configurable::InstanceMethods
- Defined in:
- lib/dragonfly/configurable.rb
Instance Method Summary collapse
- #configuration ⇒ Object
- #configure {|ConfigurationProxy.new(self)| ... } ⇒ Object
- #configure_with(configurer, *args, &block) ⇒ Object
- #has_configuration_method?(method_name) ⇒ Boolean
Instance Method Details
#configuration ⇒ Object
44 45 46 |
# File 'lib/dragonfly/configurable.rb', line 44 def configuration configuration_hash.dup end |
#configure {|ConfigurationProxy.new(self)| ... } ⇒ Object
32 33 34 35 |
# File 'lib/dragonfly/configurable.rb', line 32 def configure(&block) yield ConfigurationProxy.new(self) self end |
#configure_with(configurer, *args, &block) ⇒ Object
37 38 39 40 41 42 |
# File 'lib/dragonfly/configurable.rb', line 37 def configure_with(configurer, *args, &block) configurer = configurer_for(configurer) if configurer.is_a?(Symbol) configurer.apply_configuration(self, *args) configure(&block) if block self end |
#has_configuration_method?(method_name) ⇒ Boolean
48 49 50 |
# File 'lib/dragonfly/configurable.rb', line 48 def has_configuration_method?(method_name) configuration_methods.include?(method_name.to_sym) end |