Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/inflectious/string.rb

Instance Method Summary collapse

Instance Method Details

#adjectivizeObject



21
22
23
# File 'lib/inflectious/string.rb', line 21

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

#doerizeObject



25
26
27
# File 'lib/inflectious/string.rb', line 25

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

#gerundizeObject



29
30
31
# File 'lib/inflectious/string.rb', line 29

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

#inflectionsObject



2
3
4
# File 'lib/inflectious/string.rb', line 2

def inflections
  inflections_with_names.collect(&:first)
end

#inflections_with_namesObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/inflectious/string.rb', line 6

def inflections_with_names
  returning out = [] do
    out << [singularize, "singularize"]
    out << [pluralize, "pluralize"]
    out << [participlize, "participlize"]
    out << [gerundize, "gerundize"]
    out << [gerundize.pluralize, "gerundize plural"]
    out << [doerize, "doerize"]
    out << [doerize.pluralize, "doerize plural"]
    out << [adjectivize, "adjectivize"]
    out << [superlativize, "superlativize"]
    out << [superlativize(:adjective => true), "superlativize adjective"]
  end
end

#participlizeObject



33
34
35
# File 'lib/inflectious/string.rb', line 33

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

#stemObject



41
42
43
# File 'lib/inflectious/string.rb', line 41

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

#superlativize(options = {}) ⇒ Object



37
38
39
# File 'lib/inflectious/string.rb', line 37

def superlativize(options={})
  ActiveSupport::Inflector.superlativize(self, options)
end