Module: Dragonfly::Configurable::InstanceMethods

Defined in:
lib/dragonfly/configurable.rb

Instance Method Summary collapse

Instance Method Details

#configurationObject



44
45
46
# File 'lib/dragonfly/configurable.rb', line 44

def configuration
  configuration_hash.dup
end

#configure {|ConfigurationProxy.new(self)| ... } ⇒ Object

Yields:



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

Returns:

  • (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