Class: Threatinator::CLI::ActionBuilder
- Inherits:
-
Object
- Object
- Threatinator::CLI::ActionBuilder
- Defined in:
- lib/threatinator/cli/action_builder.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#config_hash ⇒ Object
readonly
Returns the value of attribute config_hash.
-
#extra_args ⇒ Object
readonly
Returns the value of attribute extra_args.
Instance Method Summary collapse
- #build ⇒ Object
- #feed_registry ⇒ Object
-
#initialize(config_hash, extra_args) ⇒ ActionBuilder
constructor
A new instance of ActionBuilder.
Constructor Details
#initialize(config_hash, extra_args) ⇒ ActionBuilder
Returns a new instance of ActionBuilder.
9 10 11 12 13 |
# File 'lib/threatinator/cli/action_builder.rb', line 9 def initialize(config_hash, extra_args) @extra_args = extra_args @config_hash = config_hash @feed_registry = nil end |
Instance Attribute Details
#config_hash ⇒ Object (readonly)
Returns the value of attribute config_hash.
7 8 9 |
# File 'lib/threatinator/cli/action_builder.rb', line 7 def config_hash @config_hash end |
#extra_args ⇒ Object (readonly)
Returns the value of attribute extra_args.
7 8 9 |
# File 'lib/threatinator/cli/action_builder.rb', line 7 def extra_args @extra_args end |
Instance Method Details
#build ⇒ Object
15 16 17 18 19 |
# File 'lib/threatinator/cli/action_builder.rb', line 15 def build #:nocov: raise NotImplementedError.new("#{self.class}#build not implemented") #:nocov: end |
#feed_registry ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/threatinator/cli/action_builder.rb', line 21 def feed_registry return @feed_registry unless @feed_registry.nil? feed_search_hash = config_hash["feed_search"] || {} feed_search_config = Threatinator::Config::FeedSearch.new(feed_search_hash) @feed_registry = Threatinator::FeedRegistry.build(feed_search_config) end |