Module: Dradis::Plugins::Base::ClassMethods
- Defined in:
- lib/dradis/plugins/base.rb
Instance Method Summary collapse
- #description(new_description) ⇒ Object
- #disable! ⇒ Object
- #enable! ⇒ Object
- #enabled? ⇒ Boolean
- #plugin_description ⇒ Object
- #plugin_name ⇒ Object
- #provides(*list) ⇒ Object
- #provides?(feature) ⇒ Boolean
Instance Method Details
#description(new_description) ⇒ Object
21 22 23 |
# File 'lib/dradis/plugins/base.rb', line 21 def description(new_description) @description = new_description end |
#disable! ⇒ Object
54 55 56 57 |
# File 'lib/dradis/plugins/base.rb', line 54 def disable! self.settings.update_settings(enabled: false) Dradis::Plugins::clear_enabled_list end |
#enable! ⇒ Object
49 50 51 52 |
# File 'lib/dradis/plugins/base.rb', line 49 def enable! self.settings.update_settings(enabled: true) Dradis::Plugins::clear_enabled_list end |
#enabled? ⇒ Boolean
45 46 47 |
# File 'lib/dradis/plugins/base.rb', line 45 def enabled? ActiveRecord::Type::Boolean.new.cast(self.settings.enabled) end |
#plugin_description ⇒ Object
25 26 27 |
# File 'lib/dradis/plugins/base.rb', line 25 def plugin_description @description ||= "This plugin doesn't provide a :description" end |
#plugin_name ⇒ Object
29 30 31 |
# File 'lib/dradis/plugins/base.rb', line 29 def plugin_name @plugin_name ||= self.name.split('::')[-2].underscore.to_sym end |
#provides(*list) ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/dradis/plugins/base.rb', line 33 def provides(*list) @features = list if list.include?(:upload) include Dradis::Plugins::Upload::Base include Dradis::Plugins::Mappings::Base end end |
#provides?(feature) ⇒ Boolean
41 42 43 |
# File 'lib/dradis/plugins/base.rb', line 41 def provides?(feature) @features.include?(feature) end |