class Yarrow::Schema::ValueType

Public Class Methods

inherited(subclass) click to toggle source

Automatically register when struct is defined as a class extension rather than anonymous struct class.

# File lib/yarrow/schema/value.rb, line 12
def self.inherited(subclass)
  if subclass.name
    self.register(subclass.name.downcase.to_sym)
  end
end
register(label) click to toggle source
# File lib/yarrow/schema/value.rb, line 4
def self.register(label)
  class_type = Yarrow::Schema::Types::Instance.of(self).accept(Hash)
  Yarrow::Schema::Definitions.register(label, class_type)
  self
end