Class: RankedDocument

Inherits:
Object
  • Object
show all
Defined in:
lib/mongomapper_search/ranked_document.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(document) ⇒ RankedDocument

Returns a new instance of RankedDocument.



4
5
6
# File 'lib/mongomapper_search/ranked_document.rb', line 4

def initialize(document)
  self.document = document
end

Instance Attribute Details

#documentObject

Returns the value of attribute document.



2
3
4
# File 'lib/mongomapper_search/ranked_document.rb', line 2

def document
  @document
end

#rankObject

Returns the value of attribute rank.



2
3
4
# File 'lib/mongomapper_search/ranked_document.rb', line 2

def rank
  @rank
end

Instance Method Details

#==(other_ranked_doc) ⇒ Object



8
9
10
# File 'lib/mongomapper_search/ranked_document.rb', line 8

def ==(other_ranked_doc)
   self.document == other_ranked_doc.document
end