Class: RBI::RequiresAncestor
- Inherits:
-
NodeWithComments
- Object
- Node
- NodeWithComments
- RBI::RequiresAncestor
- Extended by:
- T::Sig
- Includes:
- Indexable
- Defined in:
- lib/rbi/index.rb,
lib/rbi/model.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from NodeWithComments
Attributes inherited from Node
Instance Method Summary collapse
- #index_ids ⇒ Object
-
#initialize(name, loc: nil, comments: []) ⇒ RequiresAncestor
constructor
A new instance of RequiresAncestor.
- #to_s ⇒ Object
Methods inherited from NodeWithComments
#annotations, #merge_with, #version_requirements
Methods inherited from Node
#compatible_with?, #detach, #merge_with, #parent_conflict_tree, #parent_scope, #print, #rbs_print, #rbs_string, #replace, #satisfies_version?, #string
Constructor Details
#initialize(name, loc: nil, comments: []) ⇒ RequiresAncestor
Returns a new instance of RequiresAncestor.
1471 1472 1473 1474 |
# File 'lib/rbi/model.rb', line 1471 def initialize(name, loc: nil, comments: []) super(loc: loc, comments: comments) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
1462 1463 1464 |
# File 'lib/rbi/model.rb', line 1462 def name @name end |
Instance Method Details
#index_ids ⇒ Object
163 164 165 |
# File 'lib/rbi/index.rb', line 163 def index_ids [to_s] end |
#to_s ⇒ Object
1477 1478 1479 |
# File 'lib/rbi/model.rb', line 1477 def to_s "#{parent_scope&.fully_qualified_name}.requires_ancestor(#{name})" end |