Class: Cuprum::Collections::Errors::InvalidQuery

Inherits:
Error
  • Object
show all
Defined in:
lib/cuprum/collections/errors/invalid_query.rb

Overview

An error returned when a query is created with invalid filter parameters.

Constant Summary collapse

TYPE =

Short string used to identify the type of error.

'cuprum.collections.errors.invalid_query'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(errors:, strategy:, message: nil) ⇒ InvalidQuery

Returns a new instance of InvalidQuery.

Parameters:

  • errors (Stannum::Errors)

    The errors returned by the query builder.

  • strategy (Symbol)

    The strategy used to construct the query.



15
16
17
18
19
20
21
22
23
24
# File 'lib/cuprum/collections/errors/invalid_query.rb', line 15

def initialize(errors:, strategy:, message: nil)
  @errors   = errors
  @strategy = strategy

  super(
    errors:   errors,
    message:  message || default_message,
    strategy: strategy
  )
end

Instance Attribute Details

#errorsStannum::Errors (readonly)

Returns the errors returned by the query builder.

Returns:

  • (Stannum::Errors)

    the errors returned by the query builder.



27
28
29
# File 'lib/cuprum/collections/errors/invalid_query.rb', line 27

def errors
  @errors
end

#strategySymbol (readonly)

Returns the strategy used to construct the query.

Returns:

  • (Symbol)

    the strategy used to construct the query.



30
31
32
# File 'lib/cuprum/collections/errors/invalid_query.rb', line 30

def strategy
  @strategy
end