Exception: Graphiti::Errors::Unlinkable

Inherits:
Base
  • Object
show all
Defined in:
lib/graphiti/errors.rb

Instance Method Summary collapse

Constructor Details

#initialize(resource_class, sideload) ⇒ Unlinkable

Returns a new instance of Unlinkable.



244
245
246
247
# File 'lib/graphiti/errors.rb', line 244

def initialize(resource_class, sideload)
  @resource_class = resource_class
  @sideload = sideload
end

Instance Method Details

#messageObject



249
250
251
252
253
254
255
256
257
# File 'lib/graphiti/errors.rb', line 249

def message
  <<-MSG
    #{@resource_class.name}: Tried to link sideload #{@sideload.name.inspect}, but cannot generate links!

    Graphiti.config.context_for_endpoint must be set to enable link generation:

    Graphiti.config.context_for_endpoint = ->(path, action) { ... }
  MSG
end