Module: Mongoid::Extensions::Symbol::Inflections

Defined in:
lib/mongoid/extensions/symbol/inflections.rb

Overview

:nodoc:

Constant Summary collapse

REVERSALS =
{
  :asc => :desc,
  :ascending => :descending,
  :desc => :asc,
  :descending => :ascending
}

Instance Method Summary collapse

Instance Method Details

#invertObject



14
15
16
# File 'lib/mongoid/extensions/symbol/inflections.rb', line 14

def invert
  REVERSALS[self]
end

#plural?Boolean

Returns:



22
23
24
# File 'lib/mongoid/extensions/symbol/inflections.rb', line 22

def plural?
  to_s.plural?
end

#singular?Boolean

Returns:



18
19
20
# File 'lib/mongoid/extensions/symbol/inflections.rb', line 18

def singular?
  to_s.singular?
end