Class: Yara::ScanResult
- Inherits:
-
Object
- Object
- Yara::ScanResult
- Defined in:
- lib/yara/scan_result.rb
Constant Summary collapse
- RULE_MATCHING =
1
- RULE_NOT_MATCHING =
2
- META_FLAGS_LAST_IN_RULE =
1
- META_TYPE_INTEGER =
1
- META_TYPE_BOOLEAN =
META_TYPE_STRING = 2
3
- STRING_FLAGS_LAST_IN_RULE =
0
Instance Attribute Summary collapse
-
#callback_type ⇒ Object
readonly
Returns the value of attribute callback_type.
-
#rule ⇒ Object
readonly
Returns the value of attribute rule.
-
#rule_meta ⇒ Object
readonly
Returns the value of attribute rule_meta.
-
#rule_strings ⇒ Object
readonly
Returns the value of attribute rule_strings.
-
#user_data_number ⇒ Object
readonly
Returns the value of attribute user_data_number.
Instance Method Summary collapse
-
#initialize(callback_type, rule, user_data) ⇒ ScanResult
constructor
A new instance of ScanResult.
- #match? ⇒ Boolean
- #rule_name ⇒ Object
- #rule_outcome? ⇒ Boolean
- #scan_complete? ⇒ Boolean
Constructor Details
#initialize(callback_type, rule, user_data) ⇒ ScanResult
Returns a new instance of ScanResult.
16 17 18 19 20 21 22 |
# File 'lib/yara/scan_result.rb', line 16 def initialize(callback_type, rule, user_data) @callback_type = callback_type @rule = rule @rule_meta = @rule_strings = extract_rule_strings @user_data_number = user_data[:number] end |
Instance Attribute Details
#callback_type ⇒ Object (readonly)
Returns the value of attribute callback_type.
14 15 16 |
# File 'lib/yara/scan_result.rb', line 14 def callback_type @callback_type end |
#rule ⇒ Object (readonly)
Returns the value of attribute rule.
14 15 16 |
# File 'lib/yara/scan_result.rb', line 14 def rule @rule end |
#rule_meta ⇒ Object (readonly)
Returns the value of attribute rule_meta.
24 25 26 |
# File 'lib/yara/scan_result.rb', line 24 def @rule_meta end |
#rule_strings ⇒ Object (readonly)
Returns the value of attribute rule_strings.
24 25 26 |
# File 'lib/yara/scan_result.rb', line 24 def rule_strings @rule_strings end |
#user_data_number ⇒ Object (readonly)
Returns the value of attribute user_data_number.
24 25 26 |
# File 'lib/yara/scan_result.rb', line 24 def user_data_number @user_data_number end |
Instance Method Details
#match? ⇒ Boolean
38 39 40 |
# File 'lib/yara/scan_result.rb', line 38 def match? callback_type == RULE_MATCHING end |
#rule_name ⇒ Object
26 27 28 |
# File 'lib/yara/scan_result.rb', line 26 def rule_name @rule[:identifier] end |
#rule_outcome? ⇒ Boolean
34 35 36 |
# File 'lib/yara/scan_result.rb', line 34 def rule_outcome? [RULE_MATCHING, RULE_NOT_MATCHING].include?(callback_type) end |
#scan_complete? ⇒ Boolean
30 31 32 |
# File 'lib/yara/scan_result.rb', line 30 def scan_complete? callback_type == SCAN_FINISHED end |