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
  this_line = Kernel.caller.find {|line| !line.match(/in `inherited'$/)}
  T::Private::Sealed.validate_inheritance(this_line, 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