Class: RBI::KwArg
- Extended by:
- T::Sig
- Defined in:
- lib/rbi/model.rb,
lib/rbi/printer.rb
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
- #accept_printer(v) ⇒ Object
-
#initialize(keyword, value, loc: nil) ⇒ KwArg
constructor
A new instance of KwArg.
- #to_s ⇒ Object
Methods inherited from Node
#compatible_with?, #detach, #group_kind, #merge_with, #oneline?, #parent_conflict_tree, #parent_scope, #print, #print_blank_line_before, #replace, #string
Constructor Details
#initialize(keyword, value, loc: nil) ⇒ KwArg
Returns a new instance of KwArg.
1001 1002 1003 1004 |
# File 'lib/rbi/model.rb', line 1001 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.
992 993 994 |
# File 'lib/rbi/model.rb', line 992 def keyword @keyword end |
Instance Method Details
#==(other) ⇒ Object
1007 1008 1009 |
# File 'lib/rbi/model.rb', line 1007 def ==(other) KwArg === other && value == other.value && keyword == other.keyword end |
#accept_printer(v) ⇒ Object
592 593 594 595 596 |
# File 'lib/rbi/printer.rb', line 592 def accept_printer(v) v.print(keyword) v.print(": ") v.print(value) end |
#to_s ⇒ Object
1012 1013 1014 |
# File 'lib/rbi/model.rb', line 1012 def to_s "#{keyword}: #{value}" end |