Class: Grepfruit::SearchResults
- Inherits:
-
Object
- Object
- Grepfruit::SearchResults
- Defined in:
- lib/grepfruit/search_results.rb
Instance Attribute Summary collapse
-
#match_count ⇒ Object
readonly
Returns the value of attribute match_count.
-
#raw_matches ⇒ Object
readonly
Returns the value of attribute raw_matches.
-
#total_files ⇒ Object
Returns the value of attribute total_files.
-
#total_files_with_matches ⇒ Object
readonly
Returns the value of attribute total_files_with_matches.
Instance Method Summary collapse
- #add_match_count(count) ⇒ Object
- #add_raw_matches(matches) ⇒ Object
- #increment_files_with_matches ⇒ Object
-
#initialize ⇒ SearchResults
constructor
A new instance of SearchResults.
Constructor Details
#initialize ⇒ SearchResults
Returns a new instance of SearchResults.
6 7 8 9 10 11 |
# File 'lib/grepfruit/search_results.rb', line 6 def initialize @raw_matches = [] @total_files = 0 @total_files_with_matches = 0 @match_count = 0 end |
Instance Attribute Details
#match_count ⇒ Object (readonly)
Returns the value of attribute match_count.
3 4 5 |
# File 'lib/grepfruit/search_results.rb', line 3 def match_count @match_count end |
#raw_matches ⇒ Object (readonly)
Returns the value of attribute raw_matches.
3 4 5 |
# File 'lib/grepfruit/search_results.rb', line 3 def raw_matches @raw_matches end |
#total_files ⇒ Object
Returns the value of attribute total_files.
4 5 6 |
# File 'lib/grepfruit/search_results.rb', line 4 def total_files @total_files end |
#total_files_with_matches ⇒ Object (readonly)
Returns the value of attribute total_files_with_matches.
3 4 5 |
# File 'lib/grepfruit/search_results.rb', line 3 def total_files_with_matches @total_files_with_matches end |
Instance Method Details
#add_match_count(count) ⇒ Object
17 18 19 |
# File 'lib/grepfruit/search_results.rb', line 17 def add_match_count(count) @match_count += count end |
#add_raw_matches(matches) ⇒ Object
21 22 23 |
# File 'lib/grepfruit/search_results.rb', line 21 def add_raw_matches(matches) @raw_matches.concat(matches) end |
#increment_files_with_matches ⇒ Object
13 14 15 |
# File 'lib/grepfruit/search_results.rb', line 13 def increment_files_with_matches @total_files_with_matches += 1 end |