Module: AmberComponent::Helpers::ClassHelper
- Included in:
- Base
- Defined in:
- lib/amber_component/helpers/class_helper.rb
Overview
Adds class-specific utilities.
Instance Method Summary collapse
-
#const_name ⇒ String
Name of the constant this class/module is saved in (in the parent module).
-
#source_location ⇒ Array(String, Integer), Array(Boolean, Integer)
Get the exact place where this class/module has been defined.
Instance Method Details
#const_name ⇒ String
Name of the constant this class/module is saved in (in the parent module).
10 11 12 |
# File 'lib/amber_component/helpers/class_helper.rb', line 10 def const_name name.split('::').last end |
#source_location ⇒ Array(String, Integer), Array(Boolean, Integer)
Get the exact place where this class/module has been defined.
17 18 19 |
# File 'lib/amber_component/helpers/class_helper.rb', line 17 def source_location module_parent.const_source_location const_name end |