Class: RBI::Arg

Inherits:
Node
  • Object
show all
Defined in:
lib/rbi/model.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, #merge_with, #parent_conflict_tree, #parent_scope, #print, #rbs_print, #rbs_string, #replace, #satisfies_version?, #string

Constructor Details

#initialize(value, loc: nil) ⇒ Arg

Returns a new instance of Arg.

Signature:

  • (String value, ?loc: Loc?) -> void



1016
1017
1018
1019
# File 'lib/rbi/model.rb', line 1016

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

Instance Attribute Details

#valueObject (readonly)

Signature:

  • String



1013
1014
1015
# File 'lib/rbi/model.rb', line 1013

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object

Signature:

  • (Object? other) -> bool



1022
1023
1024
# File 'lib/rbi/model.rb', line 1022

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

#to_sObject

Signature:

  • -> String



1027
1028
1029
# File 'lib/rbi/model.rb', line 1027

def to_s
  value
end