class Graphiti::Errors::InvalidEndpoint

Public Class Methods

new(resource_class, path, action) click to toggle source
# File lib/graphiti/errors.rb, line 428
def initialize(resource_class, path, action)
  @resource_class = resource_class
  @path = path
  @action = action
end

Public Instance Methods

message() click to toggle source
# File lib/graphiti/errors.rb, line 434
      def message
        <<-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