Class: RBI::KwRestParam

Inherits:
Param show all
Extended by:
T::Sig
Defined in:
lib/rbi/model.rb,
lib/rbi/printer.rb

Instance Attribute Summary

Attributes inherited from Param

#name

Attributes inherited from NodeWithComments

#comments

Attributes inherited from Node

#loc, #parent_tree

Instance Method Summary collapse

Methods inherited from NodeWithComments

#merge_with, #oneline?

Methods inherited from Node

#compatible_with?, #detach, #group_kind, #merge_with, #oneline?, #parent_conflict_tree, #parent_scope, #print, #replace, #string

Constructor Details

#initialize(name, loc: nil, comments: [], &block) ⇒ KwRestParam

Returns a new instance of KwRestParam.



704
705
706
707
# File 'lib/rbi/model.rb', line 704

def initialize(name, loc: nil, comments: [], &block)
  super(name, loc: loc, comments: comments)
  block&.call(self)
end

Instance Method Details

#==(other) ⇒ Object



715
716
717
# File 'lib/rbi/model.rb', line 715

def ==(other)
  KwRestParam === other && name == other.name
end

#accept_printer(v) ⇒ Object



479
480
481
# File 'lib/rbi/printer.rb', line 479

def accept_printer(v)
  v.print("**#{name}")
end


484
485
486
487
# File 'lib/rbi/printer.rb', line 484

def print_comment_leading_space(v, last:)
  super
  v.print("  ")
end

#to_sObject



710
711
712
# File 'lib/rbi/model.rb', line 710

def to_s
  "**#{name}:"
end