lib/hanami/utils/string.rb
def classify
        words = underscore.split(CLASSIFY_WORD_SEPARATOR).map!(&:capitalize)
        delimiters = scan(CLASSIFY_WORD_SEPARATOR)

        delimiters.map! do |delimiter|
          delimiter == CLASSIFY_SEPARATOR ? EMPTY_STRING : NAMESPACE_SEPARATOR
        end

        self.class.new words.zip(delimiters).join
      end
# Return a CamelCase version of the string
#
# @return [String] the transformed string
#
# @since 0.1.0
#
# @example
#   require 'hanami/utils/string'
#
#   string = Hanami::Utils::String.new 'hanami_utils'
#   string.classify # => 'HanamiUtils'
Return a CamelCase version of the string
Return a CamelCase version of the string
def classify
        words = underscore.split(CLASSIFY_WORD_SEPARATOR).map!(&:capitalize)
        delimiters = scan(CLASSIFY_WORD_SEPARATOR)
        delimiters.map! do |delimiter|
          delimiter == CLASSIFY_SEPARATOR ? EMPTY_STRING : NAMESPACE_SEPARATOR
        end
        self.class.new words.zip(delimiters).join
      end
def classify words = underscore . split ( CLASSIFY_WORD_SEPARATOR ) . map! ( & :capitalize ) delimiters = scan ( CLASSIFY_WORD_SEPARATOR ) delimiters . map! do | delimiter | delimiter == CLASSIFY_SEPARATOR ? EMPTY_STRING : NAMESPACE_SEPARATOR end self . class . new words . zip ( delimiters ) . join end
Return a CamelCase version of the string
Return a CamelCase version of the string
the transformed string
the transformed string
String
since
None
example
require 'hanami/utils/string' string = Hanami::Utils::String.new 'hanami_utils' string.classify # => 'HanamiUtils'
require ' hanami / utils / string ' string = Hanami :: Utils :: String . new ' hanami_utils ' string . classify # = > ' HanamiUtils '