Class: RBI::TStructField Abstract
- Inherits:
-
NodeWithComments
- Object
- Node
- NodeWithComments
- RBI::TStructField
- Defined in:
- lib/rbi/model.rb,
lib/rbi/rewriters/merge_trees.rb
Overview
This class is abstract.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#default ⇒ Object
: String?.
-
#name ⇒ Object
: String.
-
#type ⇒ Object
: (Type | String).
Attributes inherited from NodeWithComments
Attributes inherited from Node
Instance Method Summary collapse
-
#compatible_with?(other) ⇒ Boolean
: (Node other) -> bool.
-
#fully_qualified_names ⇒ Object
abstract
: -> Array.
-
#initialize(name, type, default: nil, loc: nil, comments: []) ⇒ TStructField
constructor
: (String name, (Type | String) type, ?default: String?, ?loc: Loc?, ?comments: Array) -> void.
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
: (String name, (Type | String) type, ?default: String?, ?loc: Loc?, ?comments: Array) -> void
1020 1021 1022 1023 1024 1025 |
# File 'lib/rbi/model.rb', line 1020 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
: String?
1017 1018 1019 |
# File 'lib/rbi/model.rb', line 1017 def default @default end |
#name ⇒ Object
: String
1011 1012 1013 |
# File 'lib/rbi/model.rb', line 1011 def name @name end |
#type ⇒ Object
: (Type | String)
1014 1015 1016 |
# File 'lib/rbi/model.rb', line 1014 def type @type end |
Instance Method Details
#compatible_with?(other) ⇒ Boolean
: (Node other) -> bool
524 525 526 |
# File 'lib/rbi/rewriters/merge_trees.rb', line 524 def compatible_with?(other) other.is_a?(TStructField) && name == other.name && type == other.type && default == other.default end |
#fully_qualified_names ⇒ Object
This method is abstract.
: -> Array
1029 |
# File 'lib/rbi/model.rb', line 1029 def fully_qualified_names = raise NotImplementedError, "Abstract method called" |