Class: Zeitwerk::Inflector
- Inherits:
-
Object
- Object
- Zeitwerk::Inflector
- Defined in:
- lib/zeitwerk/inflector.rb
Overview
:nodoc:
Direct Known Subclasses
Instance Method Summary collapse
-
#camelize(basename, _abspath) ⇒ String
Very basic snake case -> camel case conversion.
Instance Method Details
#camelize(basename, _abspath) ⇒ String
Very basic snake case -> camel case conversion.
Zeitwerk::Inflector.camelize("post", ...) # => "Post"
Zeitwerk::Inflector.camelize("users_controller", ...) # => "UsersController"
Zeitwerk::Inflector.camelize("api", ...) # => "Api"
14 15 16 |
# File 'lib/zeitwerk/inflector.rb', line 14 def camelize(basename, _abspath) basename.split('_').map!(&:capitalize!).join end |