Module: Castle::Context::Prepare

Defined in:
lib/castle/context/prepare.rb

Overview

prepares the context from the request

Class Method Summary collapse

Class Method Details

.call(request, options = {}) ⇒ Hash

Parameters:

  • request (Request)
  • options (Hash) (defaults to: {})

Returns:

  • (Hash)


11
12
13
14
# File 'lib/castle/context/prepare.rb', line 11

def call(request, options = {})
  default_context = Castle::Context::GetDefault.new(request, options[:cookies]).call
  Castle::Context::Merge.call(default_context, options[:context])
end