Sha256: 0c7b90d5f3de7c6a2e808f306304959d20fe4c92e33d189cdb07a2256e6c9cd3

Contents?: true

Size: 557 Bytes

Versions: 27

Compression:

Stored size: 557 Bytes

Contents

module Dradis::Plugins
  module Configurable
    extend ActiveSupport::Concern

    module ClassMethods
      delegate :settings, to: :instance

      def settings_namespace
        @settings_namespace || plugin_name
      end

      def addon_settings(namespace = nil, &block)
        @settings_namespace = namespace if namespace
        yield self if block_given?
      end

      def instance
        @instance ||= new
      end
    end

    def settings
      @settings ||= Dradis::Plugins::Settings.new(self.class.settings_namespace)
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
dradis-plugins-4.8.0 lib/dradis/plugins/configurable.rb
dradis-plugins-4.7.0 lib/dradis/plugins/configurable.rb
dradis-plugins-4.6.1 lib/dradis/plugins/configurable.rb
dradis-plugins-4.5.0 lib/dradis/plugins/configurable.rb
dradis-plugins-4.4.0 lib/dradis/plugins/configurable.rb
dradis-plugins-4.3.0 lib/dradis/plugins/configurable.rb
dradis-plugins-4.2.0 lib/dradis/plugins/configurable.rb
dradis-plugins-4.1.0 lib/dradis/plugins/configurable.rb
dradis-plugins-4.0.0 lib/dradis/plugins/configurable.rb
dradis-plugins-3.22.0 lib/dradis/plugins/configurable.rb
dradis-plugins-3.21.0 lib/dradis/plugins/configurable.rb
dradis-plugins-3.20.0 lib/dradis/plugins/configurable.rb
dradis-plugins-3.19.0 lib/dradis/plugins/configurable.rb
dradis-plugins-3.18.0 lib/dradis/plugins/configurable.rb
dradis-plugins-3.17.0 lib/dradis/plugins/configurable.rb
dradis-plugins-3.16.0 lib/dradis/plugins/configurable.rb
dradis-plugins-3.15.0 lib/dradis/plugins/configurable.rb
dradis-plugins-3.14.0 lib/dradis/plugins/configurable.rb
dradis-plugins-3.13.0 lib/dradis/plugins/configurable.rb
dradis-plugins-3.12.0 lib/dradis/plugins/configurable.rb