module RBS::AST::Ruby::Helpers::ConstantHelper
Public Class Methods
(Prism::node?) → TypeName?
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/sig/ast/ruby/helpers/constant_helper.rbs, line 6
def self?.constant_as_type_name: (Prism::node?) -> TypeName?
Public Instance Methods
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/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