Class: Steep::Index::RBSIndex::ConstantEntry
- Defined in:
- lib/steep/index/rbs_index.rb
Instance Attribute Summary collapse
-
#const_name ⇒ Object
readonly
Returns the value of attribute const_name.
-
#declarations ⇒ Object
readonly
Returns the value of attribute declarations.
Instance Method Summary collapse
- #add_declaration(decl) ⇒ Object
-
#initialize(const_name:) ⇒ ConstantEntry
constructor
A new instance of ConstantEntry.
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_name ⇒ Object (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 |
#declarations ⇒ Object (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 |