Module: Lamby::Debug

Extended by:
Debug
Includes:
SamHelpers
Included in:
Debug
Defined in:
lib/lamby/debug.rb

Instance Method Summary collapse

Methods included from SamHelpers

#sam_local?

Instance Method Details

#call(event, context, env) ⇒ Object



12
13
14
# File 'lib/lamby/debug.rb', line 12

def call(event, context, env)
  [ 200, { 'Content-Type' => 'text/html' }, [body(event, context, env)] ]
end

#on?(event) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
10
# File 'lib/lamby/debug.rb', line 7

def on?(event)
  params = event['multiValueQueryStringParameters'] || event['queryStringParameters']
  (Rails.env.development? || ENV['LAMBY_DEBUG']) && params && params['debug'] == '1'
end