Sha256: 6894279361385b44b01c764bfc810a23f94a781ee341121bf42ec8d447171826
Contents?: true
Size: 405 Bytes
Versions: 3
Compression:
Stored size: 405 Bytes
Contents
module Adauth class SearchResults < Array def limit(x) return self[0..(x-1)] end def order(field, direction = :asc) case direction when :asc return sort! { |x, y| x.send(field) <=> y.send(field) } when :desc return order(field, :asc).reverse! else raise "Invalid Order Provided, please use :asc or :desc" end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
adauth-2.0.5 | lib/adauth/search_results.rb |
adauth-2.0.4 | lib/adauth/search_results.rb |
adauth-2.0.3 | lib/adauth/search_results.rb |