Module: Dragonfly::Configurable

Included in:
App
Defined in:
lib/dragonfly/configurable.rb

Defined Under Namespace

Classes: Configurer, UnregisteredPlugin

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configurerObject

Returns the value of attribute configurer



104
105
106
# File 'lib/dragonfly/configurable.rb', line 104

def configurer
  @configurer
end

Instance Method Details

#set_up_config(&setup_block) ⇒ Object



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/dragonfly/configurable.rb', line 85

def set_up_config(&setup_block)
  self.configurer = Configurer.new(&setup_block)
  class_eval do
    def configure(&block)
      self.class.configurer.configure(self, &block)
      self
    end

    def configure_with(plugin, *args, &block)
      self.class.configurer.configure_with_plugin(self, plugin, *args, &block)
      self
    end

    def plugins
      @plugins ||= {}
    end
  end
end