Class: RBI::RequiresAncestor
- Inherits:
-
NodeWithComments
- Object
- Node
- NodeWithComments
- RBI::RequiresAncestor
- Includes:
- Indexable
- Defined in:
- lib/rbi/index.rb,
lib/rbi/model.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
: String.
Attributes inherited from NodeWithComments
Attributes inherited from Node
Instance Method Summary collapse
-
#index_ids ⇒ Object
: -> Array.
-
#initialize(name, loc: nil, comments: []) ⇒ RequiresAncestor
constructor
: (String name, ?loc: Loc?, ?comments: Array) -> void.
-
#to_s ⇒ Object
: -> String.
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
: (String name, ?loc: Loc?, ?comments: Array) -> void
1105 1106 1107 1108 |
# File 'lib/rbi/model.rb', line 1105 def initialize(name, loc: nil, comments: []) super(loc: loc, comments: comments) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
: String
1102 1103 1104 |
# File 'lib/rbi/model.rb', line 1102 def name @name end |
Instance Method Details
#index_ids ⇒ Object
: -> Array
159 160 161 |
# File 'lib/rbi/index.rb', line 159 def index_ids [to_s] end |
#to_s ⇒ Object
: -> String
1112 1113 1114 |
# File 'lib/rbi/model.rb', line 1112 def to_s "#{parent_scope&.fully_qualified_name}.requires_ancestor(#{name})" end |