Sha256: b7137bf7ddc2df88f04dd8e065f6f4a8a8f77971e8bf699f9fdf44a19d033173

Contents?: true

Size: 1.15 KB

Versions: 14

Compression:

Stored size: 1.15 KB

Contents

# frozen_string_literal: true

module Avromatic
  module Model
    module Types
      class AbstractType
        EMPTY_ARRAY = [].freeze
        private_constant :EMPTY_ARRAY

        def value_classes
          raise "#{__method__} must be overridden by #{self.class.name}"
        end

        def input_classes
          value_classes
        end

        def name
          raise "#{__method__} must be overridden by #{self.class.name}"
        end

        def coerce(_input)
          raise "#{__method__} must be overridden by #{self.class.name}"
        end

        def coercible?(_input)
          raise "#{__method__} must be overridden by #{self.class.name}"
        end

        def coerced?(_value)
          raise "#{__method__} must be overridden by #{self.class.name}"
        end

        # Note we use positional args rather than keyword args to reduce
        # memory allocations
        def serialize(_value, _strict)
          raise "#{__method__} must be overridden by #{self.class.name}"
        end

        def referenced_model_classes
          raise "#{__method__} must be overridden by #{self.class.name}"
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
avromatic-5.1.0 lib/avromatic/model/types/abstract_type.rb
avromatic-5.0.0 lib/avromatic/model/types/abstract_type.rb
avromatic-4.3.0 lib/avromatic/model/types/abstract_type.rb
avromatic-4.2.0 lib/avromatic/model/types/abstract_type.rb
avromatic-4.1.1 lib/avromatic/model/types/abstract_type.rb
avromatic-4.1.0 lib/avromatic/model/types/abstract_type.rb
avromatic-4.0.0 lib/avromatic/model/types/abstract_type.rb
avromatic-3.0.2 lib/avromatic/model/types/abstract_type.rb
avromatic-3.0.1 lib/avromatic/model/types/abstract_type.rb
avromatic-3.0.0 lib/avromatic/model/types/abstract_type.rb
avromatic-2.4.0 lib/avromatic/model/types/abstract_type.rb
avromatic-2.3.0 lib/avromatic/model/types/abstract_type.rb
avromatic-2.2.6 lib/avromatic/model/types/abstract_type.rb
avromatic-2.2.5 lib/avromatic/model/types/abstract_type.rb