class Dradis::Plugins::Nipper::FieldProcessor

Constants

ALLOWED_DATA_NAMES

Public Instance Methods

post_initialize(args = {}) click to toggle source
# File lib/dradis/plugins/nipper/field_processor.rb, line 7
def post_initialize(args = {})
  raise 'Unhandled data name!' unless ALLOWED_DATA_NAMES.include?(data.name)

  @nipper_object =
    if data.name == 'section'
      ::Nipper::Issue.new(data)
    elsif data.name == 'devices'
      ::Nipper::Evidence.new(data)
    end
end
value(args = {}) click to toggle source
# File lib/dradis/plugins/nipper/field_processor.rb, line 18
def value(args = {})
  field = args[:field]
  _, name = field.split('.')

  @nipper_object.try(name) || 'n/a'
end