Class: RBI::BlockParam
- 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
#comments
Attributes inherited from Node
#loc, #parent_tree
Instance Method Summary
collapse
#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) ⇒ BlockParam
Returns a new instance of BlockParam.
731
732
733
734
|
# File 'lib/rbi/model.rb', line 731
def initialize(name, loc: nil, comments: [], &block)
super(name, loc: loc, comments: )
block&.call(self)
end
|
Instance Method Details
#==(other) ⇒ Object
742
743
744
|
# File 'lib/rbi/model.rb', line 742
def ==(other)
BlockParam === other && name == other.name
end
|
#accept_printer(v) ⇒ Object
494
495
496
|
# File 'lib/rbi/printer.rb', line 494
def accept_printer(v)
v.print("&#{name}")
end
|
499
500
501
502
|
# File 'lib/rbi/printer.rb', line 499
def (v, last:)
super
v.print(" ")
end
|
#to_s ⇒ Object
737
738
739
|
# File 'lib/rbi/model.rb', line 737
def to_s
"&#{name}"
end
|