class Tire::Search::Sort

Public Class Methods

new(&block) click to toggle source
# File lib/tire/search/sort.rb, line 5
def initialize(&block)
  @value = []
  block.arity < 1 ? self.instance_eval(&block) : block.call(self) if block_given?
end

Public Instance Methods

by(name, direction=nil) click to toggle source
# File lib/tire/search/sort.rb, line 10
def by(name, direction=nil)
  @value << ( direction ? { name => direction } : name )
  self
end
to_ary() click to toggle source
# File lib/tire/search/sort.rb, line 15
def to_ary
  @value
end
to_json() click to toggle source
# File lib/tire/search/sort.rb, line 19
def to_json
  @value.to_json
end