Exception: Graphiti::Errors::InvalidEndpoint
- Defined in:
- lib/graphiti/errors.rb
Instance Method Summary collapse
-
#initialize(resource_class, path, action) ⇒ InvalidEndpoint
constructor
A new instance of InvalidEndpoint.
- #message ⇒ Object
Constructor Details
#initialize(resource_class, path, action) ⇒ InvalidEndpoint
Returns a new instance of InvalidEndpoint.
389 390 391 392 393 |
# File 'lib/graphiti/errors.rb', line 389 def initialize(resource_class, path, action) @resource_class = resource_class @path = path @action = action end |
Instance Method Details
#message ⇒ Object
395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 |
# File 'lib/graphiti/errors.rb', line 395 def " \#{@resource_class.name} cannot be called directly from endpoint \#{@path}#\#{@action}!\n\n Either set a primary endpoint for this resource:\n\n primary_endpoint '/my/url', [:index, :show, :create]\n\n Or whitelist a secondary endpoint:\n\n secondary_endpoint '/my_url', [:index, :update]\n\n The current endpoints allowed for this resource are: \#{@resource_class.endpoints.inspect}\n MSG\nend\n" |