Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/soundcloud-plus/functions.rb

Instance Method Summary collapse

Instance Method Details

#pluralizeObject



15
16
17
# File 'lib/soundcloud-plus/functions.rb', line 15

def pluralize
   ActiveSupport::Inflector.pluralize(self)
end

#singular?Boolean

Uses active_support/infectors to determine if a string is singular or plural

Examples:

Determining if word is singular

"poop".singular?  # => true
"farts".singular? # => false

Returns:

  • (Boolean)


11
12
13
# File 'lib/soundcloud-plus/functions.rb', line 11

def singular?
   self.pluralize != self and self.singularize == self
end

#singularizeObject



19
20
21
# File 'lib/soundcloud-plus/functions.rb', line 19

def singularize
   ActiveSupport::Inflector.singularize(self)
end