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::Constructor

#initialize

Methods included from Props::WeakConstructor

#initialize

Methods included from Helpers

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

Methods included from Props::Serializable

#deserialize, #required_prop_missing_from_deserialize, #required_prop_missing_from_deserialize?, #serialize, #with

Methods included from Props::PrettyPrintable

#inspect, #pretty_inspect

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) do |s|
    super(s)
    raise "#{self.name} is a subclass of T::Struct and cannot be subclassed"
  end
end