Class: Yara::MatchString
- Inherits:
-
Object
- Object
- Yara::MatchString
- Defined in:
- ext/yara_native/Match.c,
lib/yara.rb,
ext/yara_native/Match.c
Overview
Encapsulates an individual matched string location. One or more of these will be available from a Match object.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#buffer ⇒ String
call-seq: matchstring.buffer() -> String.
-
#identifier ⇒ String
(also: #ident)
call-seq: matchstring.identifier() -> String.
-
#offset ⇒ Fixnum
call-seq: matchstring.offset() -> Fixnum.
- #to_a ⇒ Object
- #to_hash ⇒ Object
Instance Method Details
#<=>(other) ⇒ Object
39 40 41 |
# File 'lib/yara.rb', line 39 def <=>(other) self.offset <=> other.offset end |
#buffer ⇒ String
call-seq:
matchstring.buffer() -> String
283 284 285 286 287 |
# File 'ext/yara_native/Match.c', line 283
static VALUE matchstring_buffer(VALUE self) {
match_string *ms;
Data_Get_Struct(self, match_string, ms);
return ms->buffer;
}
|
#identifier ⇒ String Also known as: ident
call-seq:
matchstring.identifier() -> String
255 256 257 258 259 |
# File 'ext/yara_native/Match.c', line 255
static VALUE matchstring_identifier(VALUE self) {
match_string *ms;
Data_Get_Struct(self, match_string, ms);
return ms->identifier;
}
|
#offset ⇒ Fixnum
call-seq:
matchstring.offset() -> Fixnum
269 270 271 272 273 |
# File 'ext/yara_native/Match.c', line 269
static VALUE matchstring_offset(VALUE self) {
match_string *ms;
Data_Get_Struct(self, match_string, ms);
return ms->offset;
}
|
#to_a ⇒ Object
43 44 45 |
# File 'lib/yara.rb', line 43 def to_a [self.offset, self.ident, self.buffer] end |
#to_hash ⇒ Object
47 48 49 |
# File 'lib/yara.rb', line 47 def to_hash { :offset => self.offset, :identifier => self.ident, :buffer => self.buffer} end |