Class: Rack::JsonSchema::BaseRequestHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/json_schema/base_request_handler.rb

Overview

Base class for providing some utility methods to handle Rack env and JSON Schema

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env: nil, schema: nil) ⇒ BaseRequestHandler

Returns a new instance of BaseRequestHandler.

Parameters:

  • env (Hash) (defaults to: nil)

    Rack env

  • schema (JsonSchema::Schema) (defaults to: nil)

    Schema object



12
13
14
15
# File 'lib/rack/json_schema/base_request_handler.rb', line 12

def initialize(env: nil, schema: nil)
  @env = env
  @schema = schema
end

Class Method Details

.call(*args, **kwargs) ⇒ Object

Utility wrapper method



6
7
8
# File 'lib/rack/json_schema/base_request_handler.rb', line 6

def self.call(*args, **kwargs)
  new(*args, **kwargs).call
end