Module: Threatinator::Actions::Run::OutputConfigClassMethods

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

Instance Method Summary collapse

Instance Method Details

#formatsObject



19
20
21
# File 'lib/threatinator/actions/run/output_config.rb', line 19

def formats
  @plugin_loader.each(:output).map { |t, k, p| k.to_s }
end

#formats_strObject



23
24
25
# File 'lib/threatinator/actions/run/output_config.rb', line 23

def formats_str
  formats.sort.join(', ')
end

#get_plugin(name) ⇒ Object



15
16
17
# File 'lib/threatinator/actions/run/output_config.rb', line 15

def get_plugin(name)
  @plugin_loader.get(:output, name)
end

#set_plugin_loader(pl) ⇒ Object



8
9
10
11
12
13
# File 'lib/threatinator/actions/run/output_config.rb', line 8

def set_plugin_loader(pl)
  @plugin_loader = pl
  pl.each(:output) do |type, name, plugin|
    self.attribute name, plugin::Config, default: lambda { |c,a| plugin::Config.new }
  end
end