Exception: Graphiti::Errors::InvalidLink

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

Instance Method Summary collapse

Constructor Details

#initialize(resource_class, sideload, action) ⇒ InvalidLink

Returns a new instance of InvalidLink.



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

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

Instance Method Details

#messageObject



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

def message
  <<~MSG
    #{@resource_class.name}: Cannot link to sideload #{@sideload.name.inspect}!

    Make sure the endpoint "#{@sideload.resource.endpoint[:full_path]}" exists with action #{@action.inspect}, or customize the endpoint for #{@sideload.resource.class.name}.

    If you do not wish to generate a link, pass link: false or set self.autolink = false.
  MSG
end