Class: Assert::FileLine
- Inherits:
-
Object
- Object
- Assert::FileLine
- Defined in:
- lib/assert/file_line.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#line ⇒ Object
readonly
Returns the value of attribute line.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other_file_line) ⇒ Object
-
#initialize(file, line) ⇒ FileLine
constructor
A new instance of FileLine.
- #to_s ⇒ Object
Constructor Details
#initialize(file, line) ⇒ FileLine
Returns a new instance of FileLine.
11 12 13 |
# File 'lib/assert/file_line.rb', line 11 def initialize(file, line) @file, @line = file.to_s, line.to_s end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
9 10 11 |
# File 'lib/assert/file_line.rb', line 9 def file @file end |
#line ⇒ Object (readonly)
Returns the value of attribute line.
9 10 11 |
# File 'lib/assert/file_line.rb', line 9 def line @line end |
Class Method Details
.parse(file_line_path) ⇒ Object
5 6 7 |
# File 'lib/assert/file_line.rb', line 5 def self.parse(file_line_path) self.new(*file_line_path.match(/(.+)\:(.+)/)[1..2]) end |
Instance Method Details
#==(other_file_line) ⇒ Object
19 20 21 |
# File 'lib/assert/file_line.rb', line 19 def ==(other_file_line) self.file == other_file_line.file && self.line == other_file_line.line end |
#to_s ⇒ Object
15 16 17 |
# File 'lib/assert/file_line.rb', line 15 def to_s "#{self.file}:#{self.line}" end |