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.
428 429 430 431 432 |
# File 'lib/graphiti/errors.rb', line 428 def initialize(resource_class, path, action) @resource_class = resource_class @path = path @action = action end |
Instance Method Details
#message ⇒ Object
434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 |
# File 'lib/graphiti/errors.rb', line 434 def <<-MSG #{@resource_class.name} cannot be called directly from endpoint #{@path}##{@action}! Either set a primary endpoint for this resource: primary_endpoint '/my/url', [:index, :show, :create] Or whitelist a secondary endpoint: secondary_endpoint '/my_url', [:index, :update] The current endpoints allowed for this resource are: #{@resource_class.endpoints.inspect} MSG end |