Module: ContextualExceptions

Defined in:
lib/contextual_exceptions.rb,
lib/contextual_exceptions/version.rb,
lib/contextual_exceptions/class_refinement.rb,
lib/contextual_exceptions/contextual_error.rb

Defined Under Namespace

Modules: ClassRefinement, ContextualError

Constant Summary collapse

VERSION =
"0.0.2"

Class Method Summary collapse

Class Method Details

.string_to_camel_case(string) ⇒ Object

Returns This string in camel-case class name form.

Returns:

  • This string in camel-case class name form.



5
6
7
8
# File 'lib/contextual_exceptions/class_refinement.rb', line 5

def self.string_to_camel_case(string)
  class_name = string.to_s.capitalize
  class_name.gsub(/[_\s]+./) { |match| match = match[1,].capitalize }
end