Exception: Praxis::Mapper::Resources::IncompatibleTypeForMethodArguments

Inherits:
StandardError
  • Object
show all
Defined in:
lib/praxis/mapper/resources/typed_methods.rb

Overview

Error raised when trying to call a typed method and the validation of arguments fails

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(errors:, method:, klass:) ⇒ IncompatibleTypeForMethodArguments

Returns a new instance of IncompatibleTypeForMethodArguments.



10
11
12
13
# File 'lib/praxis/mapper/resources/typed_methods.rb', line 10

def initialize(errors:, method:, klass:)
  @errors = errors
  super "Error validating/coercing arguments for call to method #{method} of class #{klass}:\n#{errors}"
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



8
9
10
# File 'lib/praxis/mapper/resources/typed_methods.rb', line 8

def errors
  @errors
end

#methodObject (readonly)

Returns the value of attribute method.



8
9
10
# File 'lib/praxis/mapper/resources/typed_methods.rb', line 8

def method
  @method
end