Exception: RESTFramework::Errors::DelegatedMethodError

Inherits:
BaseError
  • Object
show all
Defined in:
lib/rest_framework/errors.rb

Instance Method Summary collapse

Constructor Details

#initialize(receiver, target) ⇒ DelegatedMethodError

Returns a new instance of DelegatedMethodError.



30
31
32
33
# File 'lib/rest_framework/errors.rb', line 30

def initialize(receiver, target)
  @receiver = receiver.is_a?(Class) ? receiver : receiver.class
  @target = target
end

Instance Method Details

#messageObject



35
36
37
38
39
40
41
42
# File 'lib/rest_framework/errors.rb', line 35

def message
  <<~MSG.squish
    Delegated action `#{@target}` does not resolve to a public method on `#{@receiver}`. This is
    almost certainly a typo, a missing method, or a method that should be public. Define a
    public class method (for a collection action) or instance method (for a member action), or
    remove the action.
  MSG
end