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.
99 100 101 102 |
# File 'lib/steep/index/rbs_index.rb', line 99 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.
96 97 98 |
# File 'lib/steep/index/rbs_index.rb', line 96 def const_name @const_name end |
#declarations ⇒ Object (readonly)
Returns the value of attribute declarations.
97 98 99 |
# File 'lib/steep/index/rbs_index.rb', line 97 def declarations @declarations end |
Instance Method Details
#add_declaration(decl) ⇒ Object
104 105 106 107 108 109 110 111 112 113 |
# File 'lib/steep/index/rbs_index.rb', line 104 def add_declaration(decl) case decl when RBS::AST::Declarations::Constant, RBS::AST::Ruby::Declarations::ConstantDecl declarations << decl else raise end self end |