Sha256: eea446ced17ee45b217b6361698ab62a3d1afaeb719c5de50ff676c42c62164e
Contents?: true
Size: 704 Bytes
Versions: 16
Compression:
Stored size: 704 Bytes
Contents
module FortyFacets # Stores the parameters of a order criteria for a search. class OrderDefinition attr(:title, :clause, :default) def initialize title, clause @title = title @clause = clause @default = false if clause.is_a? Hash if clause[:order] && clause[:default] @clause = clause[:order] @default = clause[:default] end end end def build(search, order_param) Order.new(search, self, order_param == title.to_s) end # Returns the value that is used in the request parameter to indicate that # the search result is ordered by this criteria. def request_value title end end end
Version data entries
16 entries across 16 versions & 1 rubygems