Class: RBI::Param
Instance Attribute Summary collapse
#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: []) ⇒ Param
Returns a new instance of Param.
435
436
437
438
|
# File 'lib/rbi/model.rb', line 435
def initialize(name, loc: nil, comments: [])
super(loc: loc, comments: )
@name = name
end
|
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
432
433
434
|
# File 'lib/rbi/model.rb', line 432
def name
@name
end
|
Instance Method Details
#==(other) ⇒ Object
446
447
448
449
|
# File 'lib/rbi/model.rb', line 446
def ==(other)
return false unless other.instance_of?(Param)
name == T.cast(other, Param).name
end
|
#accept_printer(v) ⇒ Object
372
373
374
|
# File 'lib/rbi/printer.rb', line 372
def accept_printer(v)
v.print(name.to_s)
end
|
377
378
379
380
381
|
# File 'lib/rbi/printer.rb', line 377
def (v)
v.printn
v.printt
v.print(" " * (name.size + 2))
end
|
#to_s ⇒ Object
441
442
443
|
# File 'lib/rbi/model.rb', line 441
def to_s
name
end
|