Sha256: 49a05521fae97ec47646523b649cdb73b78eaf312999c8b1243c9b8dca57c368
Contents?: true
Size: 786 Bytes
Versions: 15
Compression:
Stored size: 786 Bytes
Contents
# frozen_string_literal: true require 'avromatic/model/types/abstract_type' module Avromatic module Model module Types class NullType < AbstractType VALUE_CLASSES = [::NilClass].freeze def value_classes VALUE_CLASSES end def name 'null' end def coerce(input) if input.nil? nil else raise ArgumentError.new("Could not coerce '#{input.inspect}' to #{name}") end end def coercible?(input) input.nil? end alias_method :coerced?, :coercible? def serialize(_value, _strict) nil end def referenced_model_classes EMPTY_ARRAY end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems