Exception: Graphiti::Errors::RequiredFilter

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

Instance Method Summary collapse

Constructor Details

#initialize(resource, attributes) ⇒ RequiredFilter

Returns a new instance of RequiredFilter.



748
749
750
751
# File 'lib/graphiti/errors.rb', line 748

def initialize(resource, attributes)
  @resource = resource
  @attributes = Array(attributes)
end

Instance Method Details

#messageObject



753
754
755
756
757
758
759
# File 'lib/graphiti/errors.rb', line 753

def message
  if @attributes.length > 1
    "The required filters \"#{@attributes.join(", ")}\" on resource #{@resource.class} were not provided"
  else
    "The required filter \"#{@attributes[0]}\" on resource #{@resource.class} was not provided"
  end
end