Class: RequestHandler::QueryParser

Inherits:
SchemaParser show all
Defined in:
lib/request_handler/query_parser.rb

Constant Summary collapse

RESERVED_KEYS =
%w[fields filter include page sort].freeze

Instance Method Summary collapse

Constructor Details

#initialize(params:, schema:, schema_options: {}) ⇒ QueryParser

Returns a new instance of QueryParser.



9
10
11
12
13
# File 'lib/request_handler/query_parser.rb', line 9

def initialize(params:, schema:, schema_options: {})
  super(schema: schema, schema_options: schema_options)
  @query = params.dup
  RESERVED_KEYS.each { |key| query.delete(key) }
end

Instance Method Details

#runObject



15
16
17
# File 'lib/request_handler/query_parser.rb', line 15

def run
  validate_schema(query)
end