Class: Threatinator::Record
- Inherits:
-
Object
- Object
- Threatinator::Record
- Defined in:
- lib/threatinator/record.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#line_number ⇒ Object
readonly
Returns the value of attribute line_number.
-
#pos_end ⇒ Object
readonly
Returns the value of attribute pos_end.
-
#pos_start ⇒ Object
readonly
Returns the value of attribute pos_start.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #eql?(other) ⇒ Boolean
-
#initialize(data, opts = {}) ⇒ Record
constructor
A new instance of Record.
Constructor Details
#initialize(data, opts = {}) ⇒ Record
Returns a new instance of Record.
4 5 6 7 8 9 |
# File 'lib/threatinator/record.rb', line 4 def initialize(data, opts = {}) @data = data @line_number = opts[:line_number] @pos_start = opts[:pos_start] @pos_end = opts[:pos_end] end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
3 4 5 |
# File 'lib/threatinator/record.rb', line 3 def data @data end |
#line_number ⇒ Object (readonly)
Returns the value of attribute line_number.
3 4 5 |
# File 'lib/threatinator/record.rb', line 3 def line_number @line_number end |
#pos_end ⇒ Object (readonly)
Returns the value of attribute pos_end.
3 4 5 |
# File 'lib/threatinator/record.rb', line 3 def pos_end @pos_end end |
#pos_start ⇒ Object (readonly)
Returns the value of attribute pos_start.
3 4 5 |
# File 'lib/threatinator/record.rb', line 3 def pos_start @pos_start end |
Instance Method Details
#==(other) ⇒ Object
11 12 13 14 15 16 |
# File 'lib/threatinator/record.rb', line 11 def ==(other) @data == other.data && @line_number == other.line_number && @pos_start == other.pos_start && @pos_end == other.pos_end end |
#eql?(other) ⇒ Boolean
18 19 20 |
# File 'lib/threatinator/record.rb', line 18 def eql?(other) other.kind_of?(self.class) && self == other end |