Class: RBI::Mixin
- Inherits:
-
NodeWithComments
- Object
- Node
- NodeWithComments
- RBI::Mixin
- Extended by:
- T::Helpers, T::Sig
- Defined in:
- lib/rbi/model.rb,
lib/rbi/rewriters/merge_trees.rb
Overview
Mixins
Direct Known Subclasses
Instance Attribute Summary collapse
-
#names ⇒ Object
readonly
Returns the value of attribute names.
Attributes inherited from NodeWithComments
Attributes inherited from Node
Instance Method Summary collapse
- #compatible_with?(other) ⇒ Boolean
-
#initialize(name, names, loc: nil, comments: []) ⇒ Mixin
constructor
A new instance of Mixin.
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: []) ⇒ Mixin
Returns a new instance of Mixin.
862 863 864 865 |
# File 'lib/rbi/model.rb', line 862 def initialize(name, names, loc: nil, comments: []) super(loc: loc, comments: comments) @names = T.let([name, *names], T::Array[String]) end |
Instance Attribute Details
#names ⇒ Object (readonly)
Returns the value of attribute names.
852 853 854 |
# File 'lib/rbi/model.rb', line 852 def names @names end |
Instance Method Details
#compatible_with?(other) ⇒ Boolean
492 493 494 |
# File 'lib/rbi/rewriters/merge_trees.rb', line 492 def compatible_with?(other) other.is_a?(Mixin) && names == other.names end |