Class: RBI::Scope

Inherits:
Tree show all
Extended by:
T::Helpers, T::Sig
Includes:
Indexable
Defined in:
lib/rbi/model.rb,
lib/rbi/index.rb,
lib/rbi/rewriters/merge_trees.rb

Overview

Scopes

Direct Known Subclasses

Class, Module, SingletonClass, Struct

Instance Attribute Summary

Attributes inherited from Tree

#nodes

Attributes inherited from NodeWithComments

#comments

Attributes inherited from Node

#loc, #parent_tree

Instance Method Summary collapse

Methods inherited from Tree

#<<, #add_sig_templates!, #annotate!, #deannotate!, #empty?, #filter_versions!, #group_nodes!, #index, #initialize, #merge, #nest_non_public_methods!, #nest_singleton_methods!, #replace_attributes_with_methods!, #sort_nodes!

Methods inherited from NodeWithComments

#annotations, #initialize, #merge_with, #version_requirements

Methods inherited from Node

#compatible_with?, #detach, #initialize, #merge_with, #parent_conflict_tree, #parent_scope, #print, #replace, #satisfies_version?, #string

Constructor Details

This class inherits a constructor from RBI::Tree

Instance Method Details

#dup_emptyObject



358
359
360
361
362
363
364
365
366
367
368
369
370
371
# File 'lib/rbi/rewriters/merge_trees.rb', line 358

def dup_empty
  case self
  when Module
    Module.new(name, loc: loc, comments: comments)
  when Class
    Class.new(name, superclass_name: superclass_name, loc: loc, comments: comments)
  when Struct
    Struct.new(name, members: members, keyword_init: keyword_init, loc: loc, comments: comments)
  when SingletonClass
    SingletonClass.new(loc: loc, comments: comments)
  else
    raise DuplicateNodeError, "Can't duplicate node #{self}"
  end
end

#fully_qualified_nameObject



184
# File 'lib/rbi/model.rb', line 184

def fully_qualified_name; end

#index_idsObject



93
94
95
# File 'lib/rbi/index.rb', line 93

def index_ids
  [fully_qualified_name]
end

#to_sObject



187
188
189
# File 'lib/rbi/model.rb', line 187

def to_s
  fully_qualified_name
end