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
936 937 938 939 940 941 |
# File 'lib/rbi/model.rb', line 936 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?
933 934 935 |
# File 'lib/rbi/model.rb', line 933 def default @default end |
#name ⇒ Object
: String
927 928 929 |
# File 'lib/rbi/model.rb', line 927 def name @name end |
#type ⇒ Object
: (Type | String)
930 931 932 |
# File 'lib/rbi/model.rb', line 930 def type @type end |
Instance Method Details
#compatible_with?(other) ⇒ Boolean
: (Node other) -> bool
520 521 522 |
# File 'lib/rbi/rewriters/merge_trees.rb', line 520 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
945 |
# File 'lib/rbi/model.rb', line 945 def fully_qualified_names; end |