Class: Hobix::Search::Simple::SearchResult

Inherits:
Struct
  • Object
show all
Defined in:
lib/hobix/search/simple.rb,
lib/hobix/search/simple.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



28
29
30
# File 'lib/hobix/search/simple.rb', line 28

def name
  @name
end

#scoreObject

Returns the value of attribute score

Returns:

  • (Object)

    the current value of score



28
29
30
# File 'lib/hobix/search/simple.rb', line 28

def score
  @score
end

Instance Method Details

#<=>(other) ⇒ Object

enable sort by score



32
33
34
# File 'lib/hobix/search/simple.rb', line 32

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