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.



214
215
216
217
# File 'lib/graphiti/errors.rb', line 214

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

Instance Method Details

#messageObject



219
220
221
222
223
224
225
226
227
# File 'lib/graphiti/errors.rb', line 219

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