Class: Dradis::Plugins::Nikto::FieldProcessor

Inherits:
Upload::FieldProcessor
  • Object
show all
Defined in:
lib/dradis/plugins/nikto/field_processor.rb

Instance Method Summary collapse

Instance Method Details

#post_initialize(args = {}) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/dradis/plugins/nikto/field_processor.rb', line 6

def post_initialize(args={})
  @nikto_object = case data.name
    when 'scandetails' then ::Nikto::Scan.new(data)
    when 'item' then ::Nikto::Item.new(data)
    when 'ssl' then ::Nikto::Ssl.new(data)
  end
end

#value(args = {}) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/dradis/plugins/nikto/field_processor.rb', line 14

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('.')
  @nikto_object.try(name) || 'n/a'
end