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.
71 72 73 74 75 |
# File 'lib/steep/index/rbs_index.rb', line 71 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.
68 69 70 |
# File 'lib/steep/index/rbs_index.rb', line 68 def declarations @declarations end |
#method_name ⇒ Object (readonly)
Returns the value of attribute method_name.
67 68 69 |
# File 'lib/steep/index/rbs_index.rb', line 67 def method_name @method_name end |
#references ⇒ Object (readonly)
Returns the value of attribute references.
69 70 71 |
# File 'lib/steep/index/rbs_index.rb', line 69 def references @references end |
Instance Method Details
#add_declaration(decl) ⇒ Object
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
# File 'lib/steep/index/rbs_index.rb', line 77 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 when RBS::AST::Ruby::Members::DefMember declarations << decl else raise "Unexpected method declaration: #{decl}" end self end |