Class: RBI::KwOptParam

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

Instance Attribute Summary

Attributes inherited from OptParam

#value

Attributes inherited from Param

#name

Attributes inherited from NodeWithComments

#comments

Attributes inherited from Node

#loc, #parent_tree

Instance Method Summary collapse

Methods inherited from OptParam

#initialize

Methods inherited from Param

#initialize

Methods inherited from NodeWithComments

#initialize, #merge_with, #oneline?

Methods inherited from Node

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

Constructor Details

This class inherits a constructor from RBI::OptParam

Instance Method Details

#==(other) ⇒ Object



512
513
514
515
516
517
# File 'lib/rbi/model.rb', line 512

def ==(other)
  return false unless other.instance_of?(KwOptParam)
  other = T.cast(other, KwOptParam)
  return false unless name == other.name
  value == other.value
end

#accept_printer(v) ⇒ Object



433
434
435
# File 'lib/rbi/printer.rb', line 433

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


438
439
440
441
442
443
# File 'lib/rbi/printer.rb', line 438

def print_comment_leading_space(v)
  v.printn
  v.printt
  v.print(" " * (name.size + 2))
  v.print(" " * (value.size + 2))
end

#to_sObject



507
508
509
# File 'lib/rbi/model.rb', line 507

def to_s
  "#{name}:"
end