Class: RBI::Param Abstract
- Inherits:
-
NodeWithComments
- Object
- Node
- NodeWithComments
- RBI::Param
- Defined in:
- lib/rbi/model.rb,
lib/rbi/rewriters/merge_trees.rb
Overview
This class is abstract.
Direct Known Subclasses
BlockParam, KwOptParam, KwParam, KwRestParam, OptParam, ReqParam, RestParam
Instance Attribute Summary
Attributes inherited from NodeWithComments
Attributes inherited from Node
Instance Method Summary collapse
-
#anonymous? ⇒ Boolean
abstract
: -> bool.
-
#compatible_with?(other) ⇒ Boolean
: (Node? other) -> bool.
-
#initialize(loc: nil, comments: nil) ⇒ Param
constructor
: (?loc: Loc?, ?comments: Array?) -> void.
-
#name ⇒ Object
: -> String?.
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
Instance Method Details
#anonymous? ⇒ Boolean
This method is abstract.
: -> bool
617 618 619 |
# File 'lib/rbi/model.rb', line 617 def anonymous? raise NotImplementedError, "Abstract method called" end |
#compatible_with?(other) ⇒ Boolean
: (Node? other) -> bool
543 544 545 |
# File 'lib/rbi/rewriters/merge_trees.rb', line 543 def compatible_with?(other) self.class === other && (anonymous? || other.anonymous? || name == other.name) end |
#name ⇒ Object
: -> String?
608 609 610 611 612 613 |
# File 'lib/rbi/model.rb', line 608 def name case self when ReqParam, OptParam, KwParam, KwOptParam, RestParam, KwRestParam, BlockParam name end end |