Class: Ferret::Search::FieldCache::Entry
- Inherits:
-
Object
- Object
- Ferret::Search::FieldCache::Entry
- Defined in:
- lib/ferret/search/field_cache.rb
Overview
Expert: Every key in the internal cache is of this type.
Instance Attribute Summary collapse
-
#comparator ⇒ Object
readonly
Returns the value of attribute comparator.
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#sort_type ⇒ Object
readonly
Returns the value of attribute sort_type.
Instance Method Summary collapse
-
#eql?(o) ⇒ Boolean
(also: #==)
Two of these are equal iff they reference the same field and sort_type.
-
#hash ⇒ Object
Composes a hashcode based on the field and sort_type.
-
#initialize(field, sort_type, comparator = nil) ⇒ Entry
constructor
Creates one of these objects.
Constructor Details
#initialize(field, sort_type, comparator = nil) ⇒ Entry
Creates one of these objects.
14 15 16 17 18 |
# File 'lib/ferret/search/field_cache.rb', line 14 def initialize(field, sort_type, comparator = nil) @field = field @sort_type = sort_type @comparator = comparator end |
Instance Attribute Details
#comparator ⇒ Object (readonly)
Returns the value of attribute comparator.
12 13 14 |
# File 'lib/ferret/search/field_cache.rb', line 12 def comparator @comparator end |
#field ⇒ Object (readonly)
Returns the value of attribute field.
12 13 14 |
# File 'lib/ferret/search/field_cache.rb', line 12 def field @field end |
#sort_type ⇒ Object (readonly)
Returns the value of attribute sort_type.
12 13 14 |
# File 'lib/ferret/search/field_cache.rb', line 12 def sort_type @sort_type end |
Instance Method Details
#eql?(o) ⇒ Boolean Also known as: ==
Two of these are equal iff they reference the same field and sort_type.
21 22 23 24 |
# File 'lib/ferret/search/field_cache.rb', line 21 def eql?(o) return (o.instance_of? Entry and o.field == @field and o.sort_type == @sort_type and o.comparator == comparator) end |
#hash ⇒ Object
Composes a hashcode based on the field and sort_type.
28 29 30 |
# File 'lib/ferret/search/field_cache.rb', line 28 def hash() return @field.hash ^ @sort_type.hash ^ @comparator.hash end |