Class: Dradis::Plugins::Export::Base
- Inherits:
-
Object
- Object
- Dradis::Plugins::Export::Base
- Defined in:
- lib/dradis/plugins/export/base.rb
Instance Attribute Summary collapse
-
#content_service ⇒ Object
Returns the value of attribute content_service.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#options ⇒ Object
Returns the value of attribute options.
-
#plugin ⇒ Object
Returns the value of attribute plugin.
-
#project ⇒ Object
Returns the value of attribute project.
-
#scope ⇒ Object
Returns the value of attribute scope.
Instance Method Summary collapse
- #export(args = {}) ⇒ Object
-
#initialize(args = {}) ⇒ Base
constructor
A new instance of Base.
-
#post_initialize(args = {}) ⇒ Object
This method can be overwriten by plugins to do initialization tasks.
Constructor Details
#initialize(args = {}) ⇒ Base
Returns a new instance of Base.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/dradis/plugins/export/base.rb', line 10 def initialize(args={}) # Save everything just in case the implementing class needs any of it. @options = args # Can't use :fetch for :plugin or :default_plugin gets evaluated @logger = args.fetch(:logger, Rails.logger) @plugin = args[:plugin] || default_plugin @project = args.key?(:project_id) ? Project.find(args[:project_id]) : nil @scope = args.fetch(:scope, :published).to_sym @content_service = args.fetch(:content_service, default_content_service) post_initialize(args) end |
Instance Attribute Details
#content_service ⇒ Object
Returns the value of attribute content_service.
8 9 10 |
# File 'lib/dradis/plugins/export/base.rb', line 8 def content_service @content_service end |
#logger ⇒ Object
Returns the value of attribute logger.
8 9 10 |
# File 'lib/dradis/plugins/export/base.rb', line 8 def logger @logger end |
#options ⇒ Object
Returns the value of attribute options.
8 9 10 |
# File 'lib/dradis/plugins/export/base.rb', line 8 def @options end |
#plugin ⇒ Object
Returns the value of attribute plugin.
8 9 10 |
# File 'lib/dradis/plugins/export/base.rb', line 8 def plugin @plugin end |
#project ⇒ Object
Returns the value of attribute project.
8 9 10 |
# File 'lib/dradis/plugins/export/base.rb', line 8 def project @project end |
#scope ⇒ Object
Returns the value of attribute scope.
8 9 10 |
# File 'lib/dradis/plugins/export/base.rb', line 8 def scope @scope end |
Instance Method Details
#export(args = {}) ⇒ Object
25 26 27 |
# File 'lib/dradis/plugins/export/base.rb', line 25 def export(args={}) raise "The export() method is not implemented in this plugin [#{self.class.name}]." end |
#post_initialize(args = {}) ⇒ Object
This method can be overwriten by plugins to do initialization tasks.
30 31 |
# File 'lib/dradis/plugins/export/base.rb', line 30 def post_initialize(args={}) end |