Class: RBI::Helper
- Inherits:
-
NodeWithComments
- Object
- Node
- NodeWithComments
- RBI::Helper
- Includes:
- Indexable
- Defined in:
- lib/rbi/model.rb,
lib/rbi/index.rb,
lib/rbi/rewriters/merge_trees.rb
Overview
Sorbet's misc.
Instance Attribute Summary collapse
- #name ⇒ Object readonly
Attributes inherited from NodeWithComments
Attributes inherited from Node
Instance Method Summary collapse
- #compatible_with?(other) ⇒ Boolean
- #index_ids ⇒ Object
-
#initialize(name, loc: nil, comments: nil, &block) ⇒ Helper
constructor
A new instance of Helper.
- #to_s ⇒ 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(name, loc: nil, comments: nil, &block) ⇒ Helper
Returns a new instance of Helper.
1314 1315 1316 1317 1318 |
# File 'lib/rbi/model.rb', line 1314 def initialize(name, loc: nil, comments: nil, &block) super(loc: loc, comments: comments) @name = name.to_s #: String block&.call(self) end |
Instance Attribute Details
#name ⇒ Object (readonly)
1311 1312 1313 |
# File 'lib/rbi/model.rb', line 1311 def name @name end |
Instance Method Details
#compatible_with?(other) ⇒ Boolean
583 584 585 |
# File 'lib/rbi/rewriters/merge_trees.rb', line 583 def compatible_with?(other) other.is_a?(Helper) && name == other.name end |
#index_ids ⇒ Object
164 165 166 |
# File 'lib/rbi/index.rb', line 164 def index_ids [to_s] end |
#to_s ⇒ Object
1322 1323 1324 |
# File 'lib/rbi/model.rb', line 1322 def to_s "#{parent_scope&.fully_qualified_name}.#{name}!" end |