Class: RBI::TStructField
- Inherits:
-
NodeWithComments
- Object
- Node
- NodeWithComments
- RBI::TStructField
- Extended by:
- T::Helpers, T::Sig
- Defined in:
- lib/rbi/model.rb,
lib/rbi/rewriters/merge_trees.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#default ⇒ Object
Returns the value of attribute default.
-
#name ⇒ Object
Returns the value of attribute name.
-
#type ⇒ Object
Returns the value of attribute type.
Attributes inherited from NodeWithComments
Attributes inherited from Node
Instance Method Summary collapse
- #compatible_with?(other) ⇒ Boolean
- #fully_qualified_names ⇒ Object
-
#initialize(name, type, default: nil, loc: nil, comments: []) ⇒ TStructField
constructor
A new instance of TStructField.
Methods inherited from NodeWithComments
#annotations, #merge_with, #version_requirements
Methods inherited from Node
#detach, #merge_with, #parent_conflict_tree, #parent_scope, #print, #rbs_print, #rbs_string, #replace, #satisfies_version?, #string
Constructor Details
#initialize(name, type, default: nil, loc: nil, comments: []) ⇒ TStructField
Returns a new instance of TStructField.
1256 1257 1258 1259 1260 1261 |
# File 'lib/rbi/model.rb', line 1256 def initialize(name, type, default: nil, loc: nil, comments: []) super(loc: loc, comments: comments) @name = name @type = type @default = default end |
Instance Attribute Details
#default ⇒ Object
Returns the value of attribute default.
1245 1246 1247 |
# File 'lib/rbi/model.rb', line 1245 def default @default end |
#name ⇒ Object
Returns the value of attribute name.
1239 1240 1241 |
# File 'lib/rbi/model.rb', line 1239 def name @name end |
#type ⇒ Object
Returns the value of attribute type.
1242 1243 1244 |
# File 'lib/rbi/model.rb', line 1242 def type @type end |
Instance Method Details
#compatible_with?(other) ⇒ Boolean
546 547 548 |
# File 'lib/rbi/rewriters/merge_trees.rb', line 546 def compatible_with?(other) other.is_a?(TStructField) && name == other.name && type == other.type && default == other.default end |
#fully_qualified_names ⇒ Object
1264 |
# File 'lib/rbi/model.rb', line 1264 def fully_qualified_names; end |