Module: JSound::TypeFromClassName::ClassMethods
- Defined in:
- lib/jsound/type_from_class_name.rb
Overview
Class-level methods added when including TypeFromClassName
Instance Method Summary collapse
-
#type ⇒ Object
Extract the class name (from fully qualified Module::Class string) and convert camel case to snake case.
Instance Method Details
#type ⇒ Object
Extract the class name (from fully qualified Module::Class string) and convert camel case to snake case.
17 18 19 |
# File 'lib/jsound/type_from_class_name.rb', line 17 def type name.split('::').last.gsub(/(.)([A-Z])/,'\1_\2').downcase.to_sym end |