Class: RBI::Extend
- Inherits:
-
Mixin
- Object
- Node
- NodeWithComments
- Mixin
- RBI::Extend
- Includes:
- Indexable
- Defined in:
- lib/rbi/index.rb,
lib/rbi/model.rb,
lib/rbi/rewriters/merge_trees.rb
Instance Attribute Summary
Attributes inherited from Mixin
Attributes inherited from NodeWithComments
Attributes inherited from Node
Instance Method Summary collapse
-
#compatible_with?(other) ⇒ Boolean
: (Node other) -> bool.
-
#index_ids ⇒ Object
: -> Array.
-
#initialize(name, *names, loc: nil, comments: [], &block) ⇒ Extend
constructor
: (String name, *String names, ?loc: Loc?, ?comments: Array) ?{ (Extend node) -> void } -> void.
-
#to_s ⇒ Object
: -> String.
Methods inherited from NodeWithComments
#annotations, #merge_with, #version_requirements
Methods inherited from Node
#detach, #merge_with, #parent_conflict_tree, #parent_scope, #print, #rbs_print, #rbs_string, #replace, #satisfies_version?, #string
Constructor Details
#initialize(name, *names, loc: nil, comments: [], &block) ⇒ Extend
: (String name, *String names, ?loc: Loc?, ?comments: Array) ?{ (Extend node) -> void } -> void
694 695 696 697 |
# File 'lib/rbi/model.rb', line 694 def initialize(name, *names, loc: nil, comments: [], &block) super(name, names, loc: loc, comments: comments) block&.call(self) end |
Instance Method Details
#compatible_with?(other) ⇒ Boolean
: (Node other) -> bool
479 480 481 |
# File 'lib/rbi/rewriters/merge_trees.rb', line 479 def compatible_with?(other) other.is_a?(Extend) && super end |
#index_ids ⇒ Object
: -> Array
139 140 141 |
# File 'lib/rbi/index.rb', line 139 def index_ids names.map { |name| "#{parent_scope&.fully_qualified_name}.extend(#{name})" } end |
#to_s ⇒ Object
: -> String
701 702 703 |
# File 'lib/rbi/model.rb', line 701 def to_s "#{parent_scope&.fully_qualified_name}.extend(#{names.join(", ")})" end |