Class: RBI::Mixin Abstract
- Inherits:
-
NodeWithComments
- Object
- Node
- NodeWithComments
- RBI::Mixin
- Defined in:
- lib/rbi/model.rb,
lib/rbi/rewriters/merge_trees.rb
Overview
This class is abstract.
Direct Known Subclasses
Instance Attribute Summary collapse
- #names ⇒ Object readonly
Attributes inherited from NodeWithComments
Attributes inherited from Node
Instance Method Summary collapse
- #compatible_with?(other) ⇒ Boolean
-
#initialize(name, names, loc: nil, comments: nil) ⇒ Mixin
constructor
A new instance of Mixin.
Methods inherited from NodeWithComments
#annotations, #comments?, #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: nil) ⇒ Mixin
Returns a new instance of Mixin.
848 849 850 851 |
# File 'lib/rbi/model.rb', line 848 def initialize(name, names, loc: nil, comments: nil) super(loc: loc, comments: comments) @names = [name, *names].map(&:to_s) #: Array[String] end |
Instance Attribute Details
#names ⇒ Object (readonly)
845 846 847 |
# File 'lib/rbi/model.rb', line 845 def names @names end |
Instance Method Details
#compatible_with?(other) ⇒ Boolean
551 552 553 |
# File 'lib/rbi/rewriters/merge_trees.rb', line 551 def compatible_with?(other) other.is_a?(Mixin) && names == other.names end |