Class: Memorandom::PluginTemplate
- Inherits:
-
Object
- Object
- Memorandom::PluginTemplate
show all
- Defined in:
- lib/memorandom/plugins/template.rb
Constant Summary
collapse
- @@description =
"This is an unconfigured plugin using the base template"
- @@confidence =
0.80
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of PluginTemplate.
9
10
11
12
|
# File 'lib/memorandom/plugins/template.rb', line 9
def initialize(scanner)
self.scanner = scanner
self.hits = {}
end
|
Instance Attribute Details
#hits ⇒ Object
Returns the value of attribute hits.
7
8
9
|
# File 'lib/memorandom/plugins/template.rb', line 7
def hits
@hits
end
|
#scanner ⇒ Object
Returns the value of attribute scanner.
7
8
9
|
# File 'lib/memorandom/plugins/template.rb', line 7
def scanner
@scanner
end
|
Class Method Details
.confidence ⇒ Object
33
34
35
|
# File 'lib/memorandom/plugins/template.rb', line 33
def self.confidence
@@confidence
end
|
.description ⇒ Object
29
30
31
|
# File 'lib/memorandom/plugins/template.rb', line 29
def self.description
@@description
end
|
Instance Method Details
#confidence ⇒ Object
41
42
43
|
# File 'lib/memorandom/plugins/template.rb', line 41
def confidence
self.class.confidence
end
|
#description ⇒ Object
37
38
39
|
# File 'lib/memorandom/plugins/template.rb', line 37
def description
self.class.description
end
|
#report_hit(info = {}) ⇒ Object
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/memorandom/plugins/template.rb', line 14
def report_hit(info = {})
unless info[:offset] and info[:type]
raise RuntimeError, "No offset or type supplied in the hit: #{info.inspect}"
end
scanner.report_hit(info.merge({:plugin => self }))
offset = info.delete(:offset)
self.hits[offset] = info
end
|
#reset ⇒ Object
25
26
27
|
# File 'lib/memorandom/plugins/template.rb', line 25
def reset
self.hits = {}
end
|