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

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



838
839
840
841
# File 'lib/rbi/model.rb', line 838

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

Instance Attribute Details

#valueObject (readonly)

: String



835
836
837
# File 'lib/rbi/model.rb', line 835

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object

: (Object? other) -> bool



844
845
846
# File 'lib/rbi/model.rb', line 844

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

#to_sObject

: -> String



849
850
851
# File 'lib/rbi/model.rb', line 849

def to_s
  value
end