Module: Mongoid::Extensions::String::Inflections

Included in:
String
Defined in:
lib/mongoid/extensions/string/inflections.rb

Overview

:nodoc:

Constant Summary collapse

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

Instance Method Summary collapse

Instance Method Details

#invertObject



20
21
22
# File 'lib/mongoid/extensions/string/inflections.rb', line 20

def invert
  REVERSALS[self]
end

#plural?Boolean

Returns:



28
29
30
# File 'lib/mongoid/extensions/string/inflections.rb', line 28

def plural?
  pluralize == self
end

#singular?Boolean

Returns:



24
25
26
# File 'lib/mongoid/extensions/string/inflections.rb', line 24

def singular?
  singularize == self
end