Exception: Shapeable::Errors::InvalidShapeError

Inherits:
NameError
  • Object
show all
Defined in:
lib/shapeable/errors.rb

Instance Method Summary collapse

Constructor Details

#initialize(path, shape, version: nil) ⇒ InvalidShapeError

Returns a new instance of InvalidShapeError.



4
5
6
7
8
9
10
11
# File 'lib/shapeable/errors.rb', line 4

def initialize(path, shape, version: nil)
  resource = path.name.split('::').last.constantize
  if version
    super("Invalid shape #{path}::V#{version}::#{resource}#{shape.camelize}Serializer")
  else
    super("Invalid shape #{path}::#{resource}#{shape.camelize}Serializer")
  end
end