Class: RBI::MixesInClassMethods
- Inherits:
-
Mixin
- Object
- Node
- NodeWithComments
- Mixin
- RBI::MixesInClassMethods
- Extended by:
- T::Sig
- 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
- #index_ids ⇒ Object
-
#initialize(name, *names, loc: nil, comments: [], &block) ⇒ MixesInClassMethods
constructor
A new instance of MixesInClassMethods.
- #to_s ⇒ Object
Methods inherited from Mixin
Methods inherited from NodeWithComments
#annotations, #merge_with, #oneline?
Methods inherited from Node
#accept_printer, #detach, #group_kind, #merge_with, #oneline?, #parent_conflict_tree, #parent_scope, #print, #print_blank_line_before, #replace, #string
Constructor Details
#initialize(name, *names, loc: nil, comments: [], &block) ⇒ MixesInClassMethods
Returns a new instance of MixesInClassMethods.
1354 1355 1356 1357 |
# File 'lib/rbi/model.rb', line 1354 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
501 502 503 |
# File 'lib/rbi/rewriters/merge_trees.rb', line 501 def compatible_with?(other) other.is_a?(MixesInClassMethods) && super end |
#index_ids ⇒ Object
149 150 151 |
# File 'lib/rbi/index.rb', line 149 def index_ids names.map { |name| "#{parent_scope&.fully_qualified_name}.mixes_in_class_method(#{name})" } end |
#to_s ⇒ Object
1360 1361 1362 |
# File 'lib/rbi/model.rb', line 1360 def to_s "#{parent_scope&.fully_qualified_name}.mixes_in_class_methods(#{names.join(", ")})" end |