Method: Module#split
- Defined in:
- lib/quality_extensions/module/split.rb
#split ⇒ Object
Very similar to Facets’ Module#nesting, but, whereas nesting will break A::B into an array of constants represting nesting ([A, A::B]), this method will split it into an array of symbols: [:A, :B].
Note that the second element in this array, :B, is not fully qualified, so you could not do a const_get on that symbol.
19 20 21 |
# File 'lib/quality_extensions/module/split.rb', line 19 def split name.split(/::/).map(&:to_sym) end |