Sha256: 1689c2edf98d21b860814ff5964e3231618005ce9300b3b7d5246d2717e50261
Contents?: true
Size: 965 Bytes
Versions: 5
Compression:
Stored size: 965 Bytes
Contents
# frozen_string_literal: true module Dry class Struct # Raised when given input doesn't conform schema and constructor type Error = Class.new(TypeError) # Raised when defining duplicate attributes class RepeatedAttributeError < ::ArgumentError # @param [Symbol] key # attribute name that is the same as previously defined one def initialize(key) super("Attribute :#{key} has already been defined") end end # Raised when a struct doesn't have an attribute class MissingAttributeError < ::KeyError def initialize(key) super("Missing attribute: #{key.inspect}") end end # When struct class stored in ast was garbage collected because no alive objects exists # This shouldn't happen in a working application class RecycledStructError < ::RuntimeError def initialize super("Reference to struct class was garbage collected") end end end end
Version data entries
5 entries across 5 versions & 1 rubygems