Class: Hobix::Search::Simple::SearchResults
- Inherits:
-
Object
- Object
- Hobix::Search::Simple::SearchResults
- Defined in:
- lib/hobix/search/simple.rb
Instance Attribute Summary collapse
-
#results ⇒ Object
readonly
Returns the value of attribute results.
-
#warnings ⇒ Object
readonly
Returns the value of attribute warnings.
Instance Method Summary collapse
- #add_result(name, score) ⇒ Object
- #add_warning(txt) ⇒ Object
- #contains_matches ⇒ Object
-
#initialize ⇒ SearchResults
constructor
A new instance of SearchResults.
Constructor Details
#initialize ⇒ SearchResults
Returns a new instance of SearchResults.
42 43 44 45 |
# File 'lib/hobix/search/simple.rb', line 42 def initialize @warnings = [] @results = {} end |
Instance Attribute Details
#results ⇒ Object (readonly)
Returns the value of attribute results.
39 40 41 |
# File 'lib/hobix/search/simple.rb', line 39 def results @results end |
#warnings ⇒ Object (readonly)
Returns the value of attribute warnings.
38 39 40 |
# File 'lib/hobix/search/simple.rb', line 38 def warnings @warnings end |
Instance Method Details
#add_result(name, score) ⇒ Object
51 52 53 |
# File 'lib/hobix/search/simple.rb', line 51 def add_result(name, score) @results[name] = SearchResult.new(name, score) end |
#add_warning(txt) ⇒ Object
47 48 49 |
# File 'lib/hobix/search/simple.rb', line 47 def add_warning(txt) @warnings << txt end |
#contains_matches ⇒ Object
55 56 57 |
# File 'lib/hobix/search/simple.rb', line 55 def contains_matches !@results.empty? end |