Class: RBI::KwArg
Instance Attribute Summary collapse
-
#keyword ⇒ Object
readonly
Returns the value of attribute keyword.
Attributes inherited from Arg
Attributes inherited from Node
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(keyword, value, loc: nil) ⇒ KwArg
constructor
A new instance of KwArg.
- #to_s ⇒ Object
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.
1086 1087 1088 1089 |
# File 'lib/rbi/model.rb', line 1086 def initialize(keyword, value, loc: nil) super(value, loc: loc) @keyword = keyword end |
Instance Attribute Details
#keyword ⇒ Object (readonly)
Returns the value of attribute keyword.
1077 1078 1079 |
# File 'lib/rbi/model.rb', line 1077 def keyword @keyword end |
Instance Method Details
#==(other) ⇒ Object
1092 1093 1094 |
# File 'lib/rbi/model.rb', line 1092 def ==(other) KwArg === other && value == other.value && keyword == other.keyword end |
#to_s ⇒ Object
1097 1098 1099 |
# File 'lib/rbi/model.rb', line 1097 def to_s "#{keyword}: #{value}" end |