Class: RSemantic::SearchResult
- Inherits:
-
Object
- Object
- RSemantic::SearchResult
- Includes:
- Comparable
- Defined in:
- lib/rsemantic/search_result.rb
Instance Attribute Summary collapse
-
#document ⇒ Object
readonly
Returns the value of attribute document.
-
#score ⇒ Object
readonly
Returns the value of attribute score.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(document, score) ⇒ SearchResult
constructor
A new instance of SearchResult.
Constructor Details
#initialize(document, score) ⇒ SearchResult
Returns a new instance of SearchResult.
7 8 9 10 |
# File 'lib/rsemantic/search_result.rb', line 7 def initialize(document, score) @document = document @score = score end |
Instance Attribute Details
#document ⇒ Object (readonly)
Returns the value of attribute document.
5 6 7 |
# File 'lib/rsemantic/search_result.rb', line 5 def document @document end |
#score ⇒ Object (readonly)
Returns the value of attribute score.
6 7 8 |
# File 'lib/rsemantic/search_result.rb', line 6 def score @score end |
Instance Method Details
#<=>(other) ⇒ Object
12 13 14 |
# File 'lib/rsemantic/search_result.rb', line 12 def <=>(other) @score <=> other.score end |