Module: T::Private::Sealed::NoInherit

Defined in:
lib/types/private/sealed.rb

Instance Method Summary collapse

Instance Method Details

#inherited(child) ⇒ Object



6
7
8
9
10
11
# File 'lib/types/private/sealed.rb', line 6

def inherited(child)
  super
  caller_loc = T::Private::CallerUtils.find_caller {|loc| loc.base_label != 'inherited'}
  T::Private::Sealed.validate_inheritance(caller_loc, self, child, 'inherited')
  @sorbet_sealed_module_all_subclasses << child
end

#sealed_subclassesObject



13
14
15
16
17
18
19
# File 'lib/types/private/sealed.rb', line 13

def sealed_subclasses
  @sorbet_sealed_module_all_subclasses_set ||= # rubocop:disable Naming/MemoizedInstanceVariableName
    begin
      require 'set'
      Set.new(@sorbet_sealed_module_all_subclasses).freeze
    end
end