Sha256: fe4a2d6f8774466ba8de4641b4aae269a5396c0411bb609c4275978e79ab5ff9

Contents?: true

Size: 554 Bytes

Versions: 3

Compression:

Stored size: 554 Bytes

Contents

# frozen_string_literal: true

class Serega
  #
  # Base exception class
  #
  class SeregaError < StandardError; end

  # Raised when serializer is initiated using not existing attribute
  #
  # @example
  #   Serega.new(only: 'FOO')
  #   # => Attribute 'FOO' not exists (Serega::AttributeNotExist)
  class AttributeNotExist < SeregaError
    attr_reader :serializer, :attributes

    def initialize(message = nil, serializer = nil, attributes = nil)
      super(message)
      @serializer = serializer
      @attributes = attributes
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
serega-0.21.0 lib/serega/errors.rb
serega-0.20.1 lib/serega/errors.rb
serega-0.20.0 lib/serega/errors.rb