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-3.11.0 lib/dradis/plugins/configurable.rb
dradis-plugins-3.10.0 lib/dradis/plugins/configurable.rb
dradis-plugins-3.9.0 lib/dradis/plugins/configurable.rb
dradis-plugins-3.8.0 lib/dradis/plugins/configurable.rb
dradis-plugins-3.7.0 lib/dradis/plugins/configurable.rb
dradis-plugins-3.6.0 lib/dradis/plugins/configurable.rb
dradis-plugins-3.5.0 lib/dradis/plugins/configurable.rb