Class: RBI::KwArg
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, #rbs_print, #rbs_string, #replace, #satisfies_version?, #string
Constructor Details
#initialize(keyword, value, loc: nil) ⇒ KwArg
Returns a new instance of KwArg.
1004
1005
1006
1007
|
# File 'lib/rbi/model.rb', line 1004
def initialize(keyword, value, loc: nil)
super(value, loc: loc)
@keyword = keyword
end
|
Instance Attribute Details
#keyword ⇒ Object
1001
1002
1003
|
# File 'lib/rbi/model.rb', line 1001
def keyword
@keyword
end
|
Instance Method Details
#==(other) ⇒ Object
1010
1011
1012
|
# File 'lib/rbi/model.rb', line 1010
def ==(other)
KwArg === other && value == other.value && keyword == other.keyword
end
|
#to_s ⇒ Object
1015
1016
1017
|
# File 'lib/rbi/model.rb', line 1015
def to_s
"#{keyword}: #{value}"
end
|