Class: Dradis::Plugins::Upload::Importer
- Inherits:
-
Object
- Object
- Dradis::Plugins::Upload::Importer
- Defined in:
- lib/dradis/plugins/upload/importer.rb
Instance Attribute Summary collapse
-
#content_service ⇒ Object
Returns the value of attribute content_service.
-
#default_user_id ⇒ Object
Returns the value of attribute default_user_id.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#mapping_service ⇒ Object
Returns the value of attribute mapping_service.
-
#options ⇒ Object
Returns the value of attribute options.
-
#plugin ⇒ Object
Returns the value of attribute plugin.
-
#project ⇒ Object
Returns the value of attribute project.
Class Method Summary collapse
Instance Method Summary collapse
- #import(args = {}) ⇒ Object
-
#initialize(args = {}) ⇒ Importer
constructor
A new instance of Importer.
-
#post_initialize(args = {}) ⇒ Object
This method can be overwriten by plugins to do initialization tasks.
Constructor Details
#initialize(args = {}) ⇒ Importer
Returns a new instance of Importer.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/dradis/plugins/upload/importer.rb', line 23 def initialize(args={}) @options = args @default_user_id = args[:default_user_id] || -1 @logger = args.fetch(:logger, Rails.logger) @plugin = args[:plugin] || default_plugin @project = args.key?(:project_id) ? Project.find(args[:project_id]) : nil @state = args.fetch(:state, :published) @content_service = args.fetch(:content_service, default_content_service) @mapping_service = default_mapping_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/upload/importer.rb', line 8 def content_service @content_service end |
#default_user_id ⇒ Object
Returns the value of attribute default_user_id.
8 9 10 |
# File 'lib/dradis/plugins/upload/importer.rb', line 8 def default_user_id @default_user_id end |
#logger ⇒ Object
Returns the value of attribute logger.
8 9 10 |
# File 'lib/dradis/plugins/upload/importer.rb', line 8 def logger @logger end |
#mapping_service ⇒ Object
Returns the value of attribute mapping_service.
8 9 10 |
# File 'lib/dradis/plugins/upload/importer.rb', line 8 def mapping_service @mapping_service end |
#options ⇒ Object
Returns the value of attribute options.
8 9 10 |
# File 'lib/dradis/plugins/upload/importer.rb', line 8 def @options end |
#plugin ⇒ Object
Returns the value of attribute plugin.
8 9 10 |
# File 'lib/dradis/plugins/upload/importer.rb', line 8 def plugin @plugin end |
#project ⇒ Object
Returns the value of attribute project.
8 9 10 |
# File 'lib/dradis/plugins/upload/importer.rb', line 8 def project @project end |
Class Method Details
.templates ⇒ Object
19 20 21 |
# File 'lib/dradis/plugins/upload/importer.rb', line 19 def self.templates { evidence: 'evidence', issue: 'issue' } end |
Instance Method Details
#import(args = {}) ⇒ Object
38 39 40 |
# File 'lib/dradis/plugins/upload/importer.rb', line 38 def import(args={}) raise "The import() 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.
43 44 |
# File 'lib/dradis/plugins/upload/importer.rb', line 43 def post_initialize(args={}) end |