Sha256: 20d53ad6868498bcd1e5460e46421a16be1a03dc2d1226e8ab2b9075e8dafb52

Contents?: true

Size: 530 Bytes

Versions: 8

Compression:

Stored size: 530 Bytes

Contents

module Hancock::PluginConfiguration

  module ClassMethods
    def configuration
      @configuration ||= config_class.new if config_class
    end
    def config
      @configuration ||= config_class.new if config_class
    end

    def configure
      yield configuration
    end

    def reconfigure!
      if config_class
        @configuration = config_class.new
        configure &block if block_given?
      end
    end

    def config_class
    end
  end

  def self.included(base)
    base.extend(ClassMethods)
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
hancock_cms-1.0.1 lib/hancock/plugin_configuration.rb
hancock_cms-2.0.0.2 lib/hancock/plugin_configuration.rb
hancock_cms-1.0.0.4 lib/hancock/plugin_configuration.rb
hancock_cms-1.0.0.3 lib/hancock/plugin_configuration.rb
hancock_cms-2.0.0.1 lib/hancock/plugin_configuration.rb
hancock_cms-1.0.0.2 lib/hancock/plugin_configuration.rb
hancock_cms-2.0.0 lib/hancock/plugin_configuration.rb
hancock_cms-1.0.0 lib/hancock/plugin_configuration.rb