Exception: Graphiti::Errors::UnsupportedSort

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

Instance Method Summary collapse

Constructor Details

#initialize(resource, attribute, allowlist, direction) ⇒ UnsupportedSort

Returns a new instance of UnsupportedSort.



155
156
157
158
159
160
# File 'lib/graphiti/errors.rb', line 155

def initialize(resource, attribute, allowlist, direction)
  @resource = resource
  @attribute = attribute
  @allowlist = allowlist
  @direction = direction
end

Instance Method Details

#messageObject



162
163
164
165
166
# File 'lib/graphiti/errors.rb', line 162

def message
  <<~MSG
    #{@resource.class.name}: tried to sort on attribute #{@attribute.inspect}, but passed #{@direction.inspect} when only #{@allowlist.inspect} is supported.
  MSG
end