Module: Voom::Presenters::Generators::Inflectors
- Defined in:
- lib/voom/presenters/generators/inflectors.rb
Instance Method Summary collapse
- #camelize(input) ⇒ Object
- #classify(input) ⇒ Object
- #dasherize(input) ⇒ Object
- #demodulize(input) ⇒ Object
- #humanize(input) ⇒ Object
- #ordinalize(input) ⇒ Object
- #pluralize(input) ⇒ Object
- #singularize(input) ⇒ Object
- #tableize(input) ⇒ Object
- #underscore(input) ⇒ Object
Instance Method Details
#camelize(input) ⇒ Object
20 21 22 23 |
# File 'lib/voom/presenters/generators/inflectors.rb', line 20 def camelize(input) # "dry/inflector" => "Dry::Inflector" @inflector.camelize(input) end |
#classify(input) ⇒ Object
5 6 7 8 |
# File 'lib/voom/presenters/generators/inflectors.rb', line 5 def classify(input) # "books" => "Book" @inflector.classify(input) end |
#dasherize(input) ⇒ Object
30 31 32 33 |
# File 'lib/voom/presenters/generators/inflectors.rb', line 30 def dasherize(input) # "dry_inflector" => "dry-inflector" @inflector.dasherize(input) end |
#demodulize(input) ⇒ Object
40 41 42 43 |
# File 'lib/voom/presenters/generators/inflectors.rb', line 40 def demodulize(input) # "Dry::Inflector" => "Inflector" @inflector.demodulize(input) end |
#humanize(input) ⇒ Object
45 46 47 48 |
# File 'lib/voom/presenters/generators/inflectors.rb', line 45 def humanize(input) # "dry_inflector" => "Dry inflector", "author_id" => "Author" @inflector.humanize(input) end |
#ordinalize(input) ⇒ Object
50 51 52 53 |
# File 'lib/voom/presenters/generators/inflectors.rb', line 50 def ordinalize(input) # 1 => "1st @inflector.ordinalize(input) end |
#pluralize(input) ⇒ Object
10 11 12 13 |
# File 'lib/voom/presenters/generators/inflectors.rb', line 10 def pluralize(input) #book" => "books" @inflector.pluralize(input) end |
#singularize(input) ⇒ Object
15 16 17 18 |
# File 'lib/voom/presenters/generators/inflectors.rb', line 15 def singularize(input) #"books" => "book" @inflector.singularize(input) end |
#tableize(input) ⇒ Object
25 26 27 28 |
# File 'lib/voom/presenters/generators/inflectors.rb', line 25 def tableize(input) # "Book" => "books" @inflector.tableize(input) end |
#underscore(input) ⇒ Object
35 36 37 38 |
# File 'lib/voom/presenters/generators/inflectors.rb', line 35 def underscore(input) # "dry-inflector" => "dry_inflector" @inflector.underscore(input) end |