Class: Steep::Index::RBSIndex::GlobalEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/steep/index/rbs_index.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(global_name:) ⇒ GlobalEntry

Returns a new instance of GlobalEntry.



120
121
122
123
# File 'lib/steep/index/rbs_index.rb', line 120

def initialize(global_name:)
  @global_name = global_name
  @declarations = Set[]
end

Instance Attribute Details

#declarationsObject (readonly)

Returns the value of attribute declarations.



118
119
120
# File 'lib/steep/index/rbs_index.rb', line 118

def declarations
  @declarations
end

#global_nameObject (readonly)

Returns the value of attribute global_name.



117
118
119
# File 'lib/steep/index/rbs_index.rb', line 117

def global_name
  @global_name
end

Instance Method Details

#add_declaration(decl) ⇒ Object



125
126
127
128
129
130
131
132
133
134
# File 'lib/steep/index/rbs_index.rb', line 125

def add_declaration(decl)
  case decl
  when RBS::AST::Declarations::Global
    declarations << decl
  else
    raise
  end

  self
end