Class: RBI::KwOptParam
- Inherits:
-
Param
- Object
- Node
- NodeWithComments
- Param
- RBI::KwOptParam
- Extended by:
- T::Sig
- Defined in:
- lib/rbi/model.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from Param
Attributes inherited from NodeWithComments
Attributes inherited from Node
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(name, value, loc: nil, comments: [], &block) ⇒ KwOptParam
constructor
A new instance of KwOptParam.
- #to_s ⇒ Object
Methods inherited from NodeWithComments
#annotations, #merge_with, #version_requirements
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(name, value, loc: nil, comments: [], &block) ⇒ KwOptParam
Returns a new instance of KwOptParam.
772 773 774 775 776 |
# File 'lib/rbi/model.rb', line 772 def initialize(name, value, loc: nil, comments: [], &block) super(name, loc: loc, comments: comments) @value = value block&.call(self) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
761 762 763 |
# File 'lib/rbi/model.rb', line 761 def value @value end |
Instance Method Details
#==(other) ⇒ Object
784 785 786 |
# File 'lib/rbi/model.rb', line 784 def ==(other) KwOptParam === other && name == other.name end |
#to_s ⇒ Object
779 780 781 |
# File 'lib/rbi/model.rb', line 779 def to_s "#{name}:" end |