Class: T::Struct

Inherits:
InexactStruct show all
Defined in:
lib/types/struct.rb

Constant Summary

Constants included from Helpers

Helpers::Private

Class Method Summary collapse

Methods included from Props::WeakConstructor

#initialize

Methods included from Sig

#sig

Methods included from Helpers

#abstract!, #final!, #interface!, #mixes_in_class_methods, #requires_ancestor, #sealed!

Methods included from Props::Serializable

#deserialize, #serialize, #with

Methods included from Props::PrettyPrintable

#inspect, #pretty_inspect, #pretty_print

Class Method Details

.inherited(subclass) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/types/struct.rb', line 11

def self.inherited(subclass)
  super(subclass)
  T::Private::ClassUtils.replace_method(subclass.singleton_class, :inherited, true) do |s|
    super(s)
    raise "#{self.name} is a subclass of T::Struct and cannot be subclassed"
  end
end