Class: String

Inherits:
Object show all
Defined in:
lib/mongo_persist.rb,
lib/mongo_persist/core_ext.rb

Instance Method Summary collapse

Instance Method Details

#from_mongo_keyObject



54
55
56
# File 'lib/mongo_persist/core_ext.rb', line 54

def from_mongo_key
  (self =~ /^(.*)-NUM$/) ? $1.to_i : self
end

#pluralizeObject



9
10
11
# File 'lib/mongo_persist.rb', line 9

def pluralize
  "#{self}s"
end