Module: RBS::AST::Ruby::Helpers::ConstantHelper
| Relationships & Source Files | |
| Extension / Inclusion / Inheritance Descendants | |
|
Included In:
| |
| Defined in: | lib/rbs/ast/ruby/helpers/constant_helper.rb |
Class Method Summary
- .constant_as_type_name(node) mod_func
Class Method Details
.constant_as_type_name(node) (mod_func)
[ GitHub ]# File 'lib/rbs/ast/ruby/helpers/constant_helper.rb', line 10
def constant_as_type_name(node) case node when Prism::ConstantPathNode, Prism::ConstantReadNode begin TypeName.parse(node.full_name) rescue Prism::ConstantPathNode::DynamicPartsInConstantPathError nil end when Prism::ConstantWriteNode TypeName.new(name: node.name, namespace: Namespace.empty) when Prism::ConstantPathWriteNode constant_as_type_name(node.target) end end