Class: Search::Sort
- Inherits:
-
Object
- Object
- Search::Sort
- Defined in:
- lib/ferret_extensions.rb
Overview
add marshalling support to Sort
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
._load(string) ⇒ Object
178 179 180 181 182 183 184 185 186 187 188 189 |
# File 'lib/ferret_extensions.rb', line 178 def self._load(string) # we exclude the last <DOC> sorting as it is appended by new anyway if string =~ /^Sort\[(.*?)(<DOC>(!)?)?\]$/ sort_fields = $1.split(',').map do |value| value.strip! Ferret::Search::SortField._load value unless value.blank? end new sort_fields.compact else raise "invalid value: #{string}" end end |
Instance Method Details
#_dump(depth) ⇒ Object
174 175 176 |
# File 'lib/ferret_extensions.rb', line 174 def _dump(depth) to_s end |