Class: TestParser::SnippetSource::LineNumber
- Inherits:
-
Object
- Object
- TestParser::SnippetSource::LineNumber
- Includes:
- Common
- Defined in:
- lib/test_parser/snippet_source/line_number.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#line_number ⇒ Object
readonly
Returns the value of attribute line_number.
Instance Method Summary collapse
-
#initialize(file, line_number) ⇒ LineNumber
constructor
A new instance of LineNumber.
- #snippet ⇒ Object
Methods included from Common
Constructor Details
#initialize(file, line_number) ⇒ LineNumber
Returns a new instance of LineNumber.
11 12 13 |
# File 'lib/test_parser/snippet_source/line_number.rb', line 11 def initialize(file, line_number) @file, @line_number = file, line_number end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
7 8 9 |
# File 'lib/test_parser/snippet_source/line_number.rb', line 7 def file @file end |
#line_number ⇒ Object (readonly)
Returns the value of attribute line_number.
7 8 9 |
# File 'lib/test_parser/snippet_source/line_number.rb', line 7 def line_number @line_number end |
Instance Method Details
#snippet ⇒ Object
15 16 17 18 19 |
# File 'lib/test_parser/snippet_source/line_number.rb', line 15 def snippet source_code.extract_code_from_line(line_number) rescue NoCodeInLineError raise "File: #{@file}:#{@line_number}" end |