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, NoKwParam, OptParam, ReqParam, RestParam
Instance Attribute Summary
Attributes inherited from NodeWithComments
Attributes inherited from Node
Instance Method Summary collapse
- #anonymous? ⇒ Boolean abstract
- #compatible_with?(other) ⇒ Boolean
-
#initialize(loc: nil, comments: nil) ⇒ Param
constructor
A new instance of Param.
- #name ⇒ Object
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(loc: nil, comments: nil) ⇒ Param
Returns a new instance of Param.
611 612 613 |
# File 'lib/rbi/model.rb', line 611 def initialize(loc: nil, comments: nil) super(loc: loc, comments: comments) end |
Instance Method Details
#anonymous? ⇒ Boolean
This method is abstract.
625 626 627 |
# File 'lib/rbi/model.rb', line 625 def anonymous? raise NotImplementedError, "Abstract method called" end |
#compatible_with?(other) ⇒ Boolean
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
616 617 618 619 620 621 |
# File 'lib/rbi/model.rb', line 616 def name case self when ReqParam, OptParam, KwParam, KwOptParam, RestParam, KwRestParam, BlockParam name end end |