Module: Yake::DSL

Defined in:
lib/yake/dsl.rb

Instance Method Summary collapse

Instance Method Details

#handler(name, &block) ⇒ Object

Lambda handler task wrapper



11
12
13
14
15
# File 'lib/yake/dsl.rb', line 11

def handler(name, &block)
  define_method(name) do |event:nil, context:nil|
    Yake.wrap(event, context, &block)
  end
end

#logging(switch, logger = nil) ⇒ Object

Turn logging on/off



19
20
21
22
23
24
25
26
27
# File 'lib/yake/dsl.rb', line 19

def logging(switch, logger = nil)
  if switch == :on
    Yake.logger = logger
  elsif switch == :off
    Yake.logger = ::Logger.new(nil)
  else
    raise Errors::UnknownLoggingSetting, switch
  end
end