Sha256: 7dbe3c2c1e4dd14e49b527003e0d3e91d968e55d167418ce2565dd5135ac79c5

Contents?: true

Size: 803 Bytes

Versions: 2

Compression:

Stored size: 803 Bytes

Contents

# The plugin's FieldProcessor is in charge of understanding the incoming data
# from the uploaded file and extracting the fields to populate the template.
# Plugins are expected to overwrite the value() method.
#
module Dradis
  module Plugins
    module Upload

      class FieldProcessor
        attr_reader :data

        def initialize(args={})
          @data = args[:data]
          post_initialize(args)
        end

        # Inspect the data object currently stored in this processor instance
        # and extract the value of the requested field.
        #
        # Subclasses will overwrite this method.
        def value(args={})
          field = args[:field]
          "Sorry, this plugin doesn't define a FieldProcessor (called for [#{field}])"
        end
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dradis-plugins-3.0.0 lib/dradis/plugins/upload/field_processor.rb
dradis-plugins-3.0.0.pre lib/dradis/plugins/upload/field_processor.rb