Class: Retreval::Document
- Inherits:
-
Object
- Object
- Retreval::Document
- Defined in:
- lib/retreval/gold_standard.rb
Overview
A Document is a generic resource that is identified by its ID (which could be anything).
Direct Known Subclasses
Instance Attribute Summary (collapse)
-
- (Object) id
readonly
Returns the value of attribute id.
Instance Method Summary (collapse)
-
- (Object) ==(document)
Compares two Document objects according to their id.
-
- (Document) initialize(args)
constructor
Creates a new Document object with a specified id.
Constructor Details
- (Document) initialize(args)
Creates a new Document object with a specified id
360 361 362 363 |
# File 'lib/retreval/gold_standard.rb', line 360 def initialize(args) @id = args[:id].to_s raise "Can not construct a Document with an empty identifier" if @id.nil? end |
Instance Attribute Details
- (Object) id (readonly)
Returns the value of attribute id
352 353 354 |
# File 'lib/retreval/gold_standard.rb', line 352 def id @id end |
Instance Method Details
- (Object) ==(document)
Compares two Document objects according to their id
355 356 357 |
# File 'lib/retreval/gold_standard.rb', line 355 def ==(document) document.id == self.id end |