Class: Steep::Index::RBSIndex::ConstantEntry

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(const_name:) ⇒ ConstantEntry

Returns a new instance of ConstantEntry.



89
90
91
92
# File 'lib/steep/index/rbs_index.rb', line 89

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

Instance Attribute Details

#const_nameObject (readonly)

Returns the value of attribute const_name.



86
87
88
# File 'lib/steep/index/rbs_index.rb', line 86

def const_name
  @const_name
end

#declarationsObject (readonly)

Returns the value of attribute declarations.



87
88
89
# File 'lib/steep/index/rbs_index.rb', line 87

def declarations
  @declarations
end

Instance Method Details

#add_declaration(decl) ⇒ Object



94
95
96
97
98
99
100
101
102
103
# File 'lib/steep/index/rbs_index.rb', line 94

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

  self
end