Exception: Graphiti::Errors::InvalidFilterValue
- Defined in:
- lib/graphiti/errors.rb
Instance Method Summary collapse
-
#initialize(resource, filter, value) ⇒ InvalidFilterValue
constructor
A new instance of InvalidFilterValue.
- #message ⇒ Object
Constructor Details
#initialize(resource, filter, value) ⇒ InvalidFilterValue
Returns a new instance of InvalidFilterValue.
137 138 139 140 141 |
# File 'lib/graphiti/errors.rb', line 137 def initialize(resource, filter, value) @resource = resource @filter = filter @value = value end |
Instance Method Details
#message ⇒ Object
143 144 145 146 147 148 149 150 151 152 |
# File 'lib/graphiti/errors.rb', line 143 def allow = @filter.values[0][:allow] deny = @filter.values[0][:deny] msg = <<-MSG #{@resource.class.name}: tried to filter on #{@filter.keys[0].inspect}, but passed invalid value #{@value.inspect}. MSG msg << "\nAllowlist: #{allow.inspect}" if allow msg << "\nDenylist: #{deny.inspect}" if deny msg end |