Class: Search::SortField
- Inherits:
-
Object
- Object
- Search::SortField
- Defined in:
- lib/ferret_extensions.rb
Overview
add marshalling support to SortFields
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
._load(string) ⇒ Object
160 161 162 163 164 165 166 167 168 169 |
# File 'lib/ferret_extensions.rb', line 160 def self._load(string) case string when /<DOC(_ID)?>!/ then Ferret::Search::SortField::DOC_ID_REV when /<DOC(_ID)?>/ then Ferret::Search::SortField::DOC_ID when '<SCORE>!' then Ferret::Search::SortField::SCORE_REV when '<SCORE>' then Ferret::Search::SortField::SCORE when /^(\w+):<(\w+)>(!)?$/ then new($1.to_sym, :type => $2.to_sym, :reverse => !$3.nil?) else raise "invalid value: #{string}" end end |
Instance Method Details
#_dump(depth) ⇒ Object
156 157 158 |
# File 'lib/ferret_extensions.rb', line 156 def _dump(depth) to_s end |