Sha256: 33710b1da56ae9e53144c2f171597480916e398fa0157599b59ba804f0c7a1a6
Contents?: true
Size: 771 Bytes
Versions: 29
Compression:
Stored size: 771 Bytes
Contents
# encoding: utf-8 module Mongoid #:nodoc: module Extensions #:nodoc: module Symbol #:nodoc: module Inflections #:nodoc: REVERSALS = { :asc => :desc, :ascending => :descending, :desc => :asc, :descending => :ascending } def invert REVERSALS[self] end def singular? to_s.singular? end def plural? to_s.plural? end ["gt", "lt", "gte", "lte", "ne", "in", "nin", "mod", "all", "size", "exists"].each do |oper| class_eval <<-OPERATORS def #{oper} ComplexCriterion.new(:key => self, :operator => "#{oper}") end OPERATORS end end end end end
Version data entries
29 entries across 29 versions & 1 rubygems