Class: RBI::KwArg

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

Instance Attribute Summary collapse

Attributes inherited from Arg

#value

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, #replace, #satisfies_version?, #string

Constructor Details

#initialize(keyword, value, loc: nil) ⇒ KwArg

Returns a new instance of KwArg.



1084
1085
1086
1087
# File 'lib/rbi/model.rb', line 1084

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

Instance Attribute Details

#keywordObject (readonly)

Returns the value of attribute keyword.



1075
1076
1077
# File 'lib/rbi/model.rb', line 1075

def keyword
  @keyword
end

Instance Method Details

#==(other) ⇒ Object



1090
1091
1092
# File 'lib/rbi/model.rb', line 1090

def ==(other)
  KwArg === other && value == other.value && keyword == other.keyword
end

#to_sObject



1095
1096
1097
# File 'lib/rbi/model.rb', line 1095

def to_s
  "#{keyword}: #{value}"
end