Class: Brainchat::Retriever::Chunk
- Inherits:
-
Data
- Object
- Data
- Brainchat::Retriever::Chunk
- Defined in:
- lib/brainchat/retriever.rb
Overview
One retrieved chunk. Data.define gives an immutable value object with
free keyword construction, matching the Finding idiom in leakless.
Instance Attribute Summary collapse
-
#end_line ⇒ Object
readonly
Returns the value of attribute end_line.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#rank ⇒ Object
readonly
Returns the value of attribute rank.
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
-
#source_type ⇒ Object
readonly
Returns the value of attribute source_type.
-
#start_line ⇒ Object
readonly
Returns the value of attribute start_line.
-
#symbol ⇒ Object
readonly
Returns the value of attribute symbol.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#location ⇒ Object
"path:12-40", or just "path" for chunks without line information (git-commit chunks carry start_line/end_line of 0).
Instance Attribute Details
#end_line ⇒ Object (readonly)
Returns the value of attribute end_line
24 25 26 |
# File 'lib/brainchat/retriever.rb', line 24 def end_line @end_line end |
#path ⇒ Object (readonly)
Returns the value of attribute path
24 25 26 |
# File 'lib/brainchat/retriever.rb', line 24 def path @path end |
#rank ⇒ Object (readonly)
Returns the value of attribute rank
24 25 26 |
# File 'lib/brainchat/retriever.rb', line 24 def rank @rank end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo
24 25 26 |
# File 'lib/brainchat/retriever.rb', line 24 def repo @repo end |
#source_type ⇒ Object (readonly)
Returns the value of attribute source_type
24 25 26 |
# File 'lib/brainchat/retriever.rb', line 24 def source_type @source_type end |
#start_line ⇒ Object (readonly)
Returns the value of attribute start_line
24 25 26 |
# File 'lib/brainchat/retriever.rb', line 24 def start_line @start_line end |
#symbol ⇒ Object (readonly)
Returns the value of attribute symbol
24 25 26 |
# File 'lib/brainchat/retriever.rb', line 24 def symbol @symbol end |
#text ⇒ Object (readonly)
Returns the value of attribute text
24 25 26 |
# File 'lib/brainchat/retriever.rb', line 24 def text @text end |
Instance Method Details
#location ⇒ Object
"path:12-40", or just "path" for chunks without line information (git-commit chunks carry start_line/end_line of 0).
27 28 29 30 31 |
# File 'lib/brainchat/retriever.rb', line 27 def location return path.to_s if start_line.to_i.zero? && end_line.to_i.zero? "#{path}:#{start_line}-#{end_line}" end |