Class: Ripgrep::Match
- Inherits:
-
Object
- Object
- Ripgrep::Match
- Defined in:
- lib/ripgrep/match.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#raw_line ⇒ Object
readonly
Returns the value of attribute raw_line.
Instance Method Summary collapse
-
#initialize(file:, body:, raw_line:) ⇒ Match
constructor
A new instance of Match.
- #to_json ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(file:, body:, raw_line:) ⇒ Match
Returns a new instance of Match.
5 6 7 8 9 |
# File 'lib/ripgrep/match.rb', line 5 def initialize(file:, body:, raw_line:) @file = file @body = body @raw_line = raw_line end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
3 4 5 |
# File 'lib/ripgrep/match.rb', line 3 def body @body end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
3 4 5 |
# File 'lib/ripgrep/match.rb', line 3 def file @file end |
#raw_line ⇒ Object (readonly)
Returns the value of attribute raw_line.
3 4 5 |
# File 'lib/ripgrep/match.rb', line 3 def raw_line @raw_line end |
Instance Method Details
#to_json ⇒ Object
15 16 17 |
# File 'lib/ripgrep/match.rb', line 15 def to_json { file: file, body: body, raw_line: raw_line }.to_json end |
#to_s ⇒ Object
11 12 13 |
# File 'lib/ripgrep/match.rb', line 11 def to_s raw_line end |