Class: Search::Simple::SearchResult

Inherits:
Struct
  • Object
show all
Defined in:
lib/search/simple/searcher.rb,
lib/search/simple/searcher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



26
27
28
# File 'lib/search/simple/searcher.rb', line 26

def name
  @name
end

#scoreObject

Returns the value of attribute score

Returns:

  • (Object)

    the current value of score



26
27
28
# File 'lib/search/simple/searcher.rb', line 26

def score
  @score
end

Instance Method Details

#<=>(other) ⇒ Object

enable sort by score



30
31
32
# File 'lib/search/simple/searcher.rb', line 30

def <=>(other)
  self.score <=> other.score
end