Class: Dradis::Plugins::Acunetix::FieldProcessor
- Inherits:
-
Upload::FieldProcessor
- Object
- Upload::FieldProcessor
- Dradis::Plugins::Acunetix::FieldProcessor
- Defined in:
- lib/dradis/plugins/acunetix/field_processor.rb
Overview
This processor defers to ::Acunetix::Scan for the scan template and to ::Acunetix::ReportItem for the report_item and evidence templates.
Instance Method Summary collapse
Instance Method Details
#post_initialize(args = {}) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/dradis/plugins/acunetix/field_processor.rb', line 6 def post_initialize(args={}) @acunetix_object = case data.name when 'Scan' ::Acunetix::Scan.new(data) when 'vulnerability' ::Acunetix::Vulnerability.new(data) else ::Acunetix::ReportItem.new(data) end end |
#value(args = {}) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/dradis/plugins/acunetix/field_processor.rb', line 18 def value(args={}) field = args[:field] # fields in the template are of the form <foo>.<field>, where <foo> # is common across all fields for a given template (and meaningless). _, name = field.split('.') @acunetix_object.try(name) || 'n/a' end |