Method: CSL::Node.constantize
- Defined in:
- lib/csl/node.rb
.constantize(name) ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/csl/node.rb', line 44 def constantize(name) pattern = /:#{name.to_s.tr('-', '')}$/i klass = types.detect { |t| t.matches?(pattern) } case when !klass.nil? klass when nesting[-2].respond_to?(:constantize) nesting[-2].constantize(name) else nil end end |