Class: RBI::SigParam
- Inherits:
-
NodeWithComments
- Object
- Node
- NodeWithComments
- RBI::SigParam
- Extended by:
- T::Sig
- Defined in:
- lib/rbi/model.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Attributes inherited from NodeWithComments
Attributes inherited from Node
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(name, type, loc: nil, comments: [], &block) ⇒ SigParam
constructor
A new instance of SigParam.
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, type, loc: nil, comments: [], &block) ⇒ SigParam
Returns a new instance of SigParam.
1200 1201 1202 1203 1204 1205 |
# File 'lib/rbi/model.rb', line 1200 def initialize(name, type, loc: nil, comments: [], &block) super(loc: loc, comments: comments) @name = name @type = type block&.call(self) end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
1186 1187 1188 |
# File 'lib/rbi/model.rb', line 1186 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
1189 1190 1191 |
# File 'lib/rbi/model.rb', line 1189 def type @type end |
Instance Method Details
#==(other) ⇒ Object
1208 1209 1210 |
# File 'lib/rbi/model.rb', line 1208 def ==(other) other.is_a?(SigParam) && name == other.name && type.to_s == other.type.to_s end |