Exception: Graphiti::Errors::FilterGroupMissingRequiredFilters

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

Instance Method Summary collapse

Constructor Details

#initialize(resource, filter_names, required) ⇒ FilterGroupMissingRequiredFilters

Returns a new instance of FilterGroupMissingRequiredFilters.



841
842
843
844
845
# File 'lib/graphiti/errors.rb', line 841

def initialize(resource, filter_names, required)
  @resource = resource
  @filter_names = filter_names
  @required_label = required == :all ? "All" : "One"
end

Instance Method Details

#messageObject



847
848
849
850
851
852
# File 'lib/graphiti/errors.rb', line 847

def message
  <<-MSG.gsub(/\s+/, " ").strip
    #{@required_label} of the following filters must be provided on resource #{@resource.type}:
    #{@filter_names.join(", ")}
  MSG
end