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
: 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
-
#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
957 958 959 960 961 962 |
# File 'lib/rbi/model.rb', line 957 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?
954 955 956 |
# File 'lib/rbi/model.rb', line 954 def default @default end |
#name ⇒ Object
: String
948 949 950 |
# File 'lib/rbi/model.rb', line 948 def name @name end |
#type ⇒ Object
: (Type | String)
951 952 953 |
# File 'lib/rbi/model.rb', line 951 def type @type end |
Instance Method Details
#compatible_with?(other) ⇒ Boolean
: (Node other) -> bool
511 512 513 |
# File 'lib/rbi/rewriters/merge_trees.rb', line 511 def compatible_with?(other) other.is_a?(TStructField) && name == other.name && type == other.type && default == other.default end |
#fully_qualified_names ⇒ Object
965 |
# File 'lib/rbi/model.rb', line 965 def fully_qualified_names; end |