Class: RBI::TStruct

Inherits:
Class show all
Extended by:
T::Sig
Defined in:
lib/rbi/model.rb

Overview

Sorbet’s T::Struct

Instance Attribute Summary

Attributes inherited from Class

#name, #superclass_name

Attributes inherited from Tree

#nodes

Attributes inherited from NodeWithComments

#comments

Attributes inherited from Node

#loc, #parent_tree

Instance Method Summary collapse

Methods inherited from Class

#compatible_with?, #fully_qualified_name, #print_header

Methods inherited from Scope

#accept_printer, #dup_empty, #fully_qualified_name, #index_ids, #print_body, #print_header, #to_s

Methods included from Indexable

#index_ids

Methods inherited from Tree

#<<, #accept_printer, #add_sig_templates!, #annotate!, #deannotate!, #empty?, #group_nodes!, #index, #merge, #nest_non_public_methods!, #nest_singleton_methods!, #oneline?, #sort_nodes!

Methods inherited from NodeWithComments

#annotations, #merge_with, #oneline?

Methods inherited from Node

#accept_printer, #compatible_with?, #detach, #group_kind, #merge_with, #oneline?, #parent_conflict_tree, #parent_scope, #print, #print_blank_line_before, #replace, #string

Constructor Details

#initialize(name, loc: nil, comments: [], &block) ⇒ TStruct

Returns a new instance of TStruct.



1127
1128
1129
1130
# File 'lib/rbi/model.rb', line 1127

def initialize(name, loc: nil, comments: [], &block)
  super(name, superclass_name: "::T::Struct", loc: loc, comments: comments) {}
  block&.call(self)
end