Sha256: 086c68fd3789a222e12f5edf1bfd8350c2899b6fe93e02d88daf5ae86c774ea4
Contents?: true
Size: 577 Bytes
Versions: 15
Compression:
Stored size: 577 Bytes
Contents
# frozen_string_literal: true module Zeitwerk class Inflector # :nodoc: # Very basic snake case -> camel case conversion. # # inflector = Zeitwerk::Inflector.new # inflector.camelize("post", ...) # => "Post" # inflector.camelize("users_controller", ...) # => "UsersController" # inflector.camelize("api", ...) # => "Api" # # @param basename [String] # @param _abspath [String] # @return [String] def camelize(basename, _abspath) basename.split('_').map!(&:capitalize).join end end end
Version data entries
15 entries across 10 versions & 2 rubygems