Class: RBI::Arg

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

Direct Known Subclasses

KwArg

Instance Attribute Summary collapse

Attributes inherited from Node

#loc, #parent_tree

Instance Method Summary collapse

Methods inherited from Node

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

Constructor Details

#initialize(value, loc: nil) ⇒ Arg

Returns a new instance of Arg.



972
973
974
975
# File 'lib/rbi/model.rb', line 972

def initialize(value, loc: nil)
  super(loc: loc)
  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



964
965
966
# File 'lib/rbi/model.rb', line 964

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object



978
979
980
# File 'lib/rbi/model.rb', line 978

def ==(other)
  Arg === other && value == other.value
end

#accept_printer(v) ⇒ Object



583
584
585
# File 'lib/rbi/printer.rb', line 583

def accept_printer(v)
  v.print(value)
end

#to_sObject



983
984
985
# File 'lib/rbi/model.rb', line 983

def to_s
  value
end