Class: Mihari::Analyzers::FreeText

Inherits:
Base
  • Object
show all
Defined in:
lib/mihari/analyzers/free_text.rb

Constant Summary collapse

ANALYZERS =
[
  Mihari::Analyzers::BinaryEdge,
  Mihari::Analyzers::Censys,
].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

inherited, #run, #run_emitter, #source

Methods included from Retriable

#retry_on_error

Methods included from Configurable

#config_keys, #configuration_status, #configured?

Constructor Details

#initialize(query, title: nil, description: nil, tags: []) ⇒ FreeText

Returns a new instance of FreeText.



19
20
21
22
23
24
25
26
27
# File 'lib/mihari/analyzers/free_text.rb', line 19

def initialize(query, title: nil, description: nil, tags: [])
  super()

  @query = query

  @title = title || "Free text cross search"
  @description = description || "query = #{query}"
  @tags = tags
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



11
12
13
# File 'lib/mihari/analyzers/free_text.rb', line 11

def description
  @description
end

#queryObject (readonly)

Returns the value of attribute query.



8
9
10
# File 'lib/mihari/analyzers/free_text.rb', line 8

def query
  @query
end

#tagsObject (readonly)

Returns the value of attribute tags.



12
13
14
# File 'lib/mihari/analyzers/free_text.rb', line 12

def tags
  @tags
end

#titleObject (readonly)

Returns the value of attribute title.



10
11
12
# File 'lib/mihari/analyzers/free_text.rb', line 10

def title
  @title
end

Instance Method Details

#artifactsObject



29
30
31
32
33
# File 'lib/mihari/analyzers/free_text.rb', line 29

def artifacts
  Parallel.map(analyzers) do |analyzer|
    run_analyzer analyzer
  end.flatten
end