Exception: Serega::AttributeNotExist

Inherits:
SeregaError
  • Object
show all
Defined in:
lib/serega/errors.rb

Overview

Raised when serializer is initiated using not existing attribute

Examples:

Serega.new(only: 'FOO')
# => Attribute 'FOO' not exists (Serega::AttributeNotExist)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message = nil, serializer = nil, attributes = nil) ⇒ AttributeNotExist

Returns a new instance of AttributeNotExist.



17
18
19
20
21
# File 'lib/serega/errors.rb', line 17

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

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



15
16
17
# File 'lib/serega/errors.rb', line 15

def attributes
  @attributes
end

#serializerObject (readonly)

Returns the value of attribute serializer.



15
16
17
# File 'lib/serega/errors.rb', line 15

def serializer
  @serializer
end