Class: RSemantic::SearchResult

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/rsemantic/search_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#documentObject (readonly)

Returns the value of attribute document.



5
6
7
# File 'lib/rsemantic/search_result.rb', line 5

def document
  @document
end

#scoreObject (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