Class: Steep::Index::RBSIndex::MethodEntry
- Defined in:
- lib/steep/index/rbs_index.rb
Instance Attribute Summary collapse
-
#declarations ⇒ Object
readonly
Returns the value of attribute declarations.
-
#method_name ⇒ Object
readonly
Returns the value of attribute method_name.
-
#references ⇒ Object
readonly
Returns the value of attribute references.
Instance Method Summary collapse
- #add_declaration(decl) ⇒ Object
-
#initialize(method_name:) ⇒ MethodEntry
constructor
A new instance of MethodEntry.
Constructor Details
#initialize(method_name:) ⇒ MethodEntry
Returns a new instance of MethodEntry.
63 64 65 66 67 |
# File 'lib/steep/index/rbs_index.rb', line 63 def initialize(method_name:) @method_name = method_name @declarations = Set[] @references = Set[] end |
Instance Attribute Details
#declarations ⇒ Object (readonly)
Returns the value of attribute declarations.
60 61 62 |
# File 'lib/steep/index/rbs_index.rb', line 60 def declarations @declarations end |
#method_name ⇒ Object (readonly)
Returns the value of attribute method_name.
59 60 61 |
# File 'lib/steep/index/rbs_index.rb', line 59 def method_name @method_name end |
#references ⇒ Object (readonly)
Returns the value of attribute references.
61 62 63 |
# File 'lib/steep/index/rbs_index.rb', line 61 def references @references end |
Instance Method Details
#add_declaration(decl) ⇒ Object
69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/steep/index/rbs_index.rb', line 69 def add_declaration(decl) case decl when RBS::AST::Members::MethodDefinition, RBS::AST::Members::Alias, RBS::AST::Members::AttrWriter, RBS::AST::Members::AttrReader, RBS::AST::Members::AttrAccessor declarations << decl else raise "Unexpected method declaration: #{decl}" end self end |