Class: RSpec::Covers::CodeLocation
- Inherits:
-
Struct
- Object
- Struct
- RSpec::Covers::CodeLocation
- Defined in:
- lib/rspec/covers/code_location.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
Returns the value of attribute file.
-
#line ⇒ Object
Returns the value of attribute line.
Instance Method Summary collapse
-
#initialize(file:, line:) ⇒ CodeLocation
constructor
A new instance of CodeLocation.
- #to_h ⇒ Object
Constructor Details
#initialize(file:, line:) ⇒ CodeLocation
Returns a new instance of CodeLocation.
8 9 10 |
# File 'lib/rspec/covers/code_location.rb', line 8 def initialize(file:, line:) super(file: File.(file), line: line.to_i) end |
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file
7 8 9 |
# File 'lib/rspec/covers/code_location.rb', line 7 def file @file end |
#line ⇒ Object
Returns the value of attribute line
7 8 9 |
# File 'lib/rspec/covers/code_location.rb', line 7 def line @line end |
Instance Method Details
#to_h ⇒ Object
12 13 14 |
# File 'lib/rspec/covers/code_location.rb', line 12 def to_h { file: file, line: line } end |