Module: Threatinator::Actions::Run::Config

Defined in:
lib/threatinator/actions/run/config.rb

Class Method Summary collapse

Class Method Details

.generate(plugin_loader) ⇒ Class

Returns a class that represents the config for Action::Run.

Parameters:

Returns:

  • (Class)

    a class that represents the config for Action::Run



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/threatinator/actions/run/config.rb', line 10

def self.generate(plugin_loader)
  output_config_class = Threatinator::Actions::Run::OutputConfig.generate(plugin_loader)
  config_class = Class.new(Threatinator::Config::Base) do
    attribute :output, output_config_class, 
      default: lambda { |c,a| output_config_class.new }

    attribute :feed_provider, String, 
      description: "The feed provider" 

    attribute :feed_name, String, 
      description: "The feed name" 

    attribute :fetch_from_file, String, 
      description: "Read data from the specified file rather than fetching"

    attribute :observers, Array, default:  lambda {|c,a| Array.new }
  end
  config_class
end