Module: Lambdakiq::Event

Extended by:
Event
Included in:
Event
Defined in:
lib/lambdakiq/event.rb

Instance Method Summary collapse

Instance Method Details

#job?(record) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/lambdakiq/event.rb', line 8

def job?(record)
  record.dig('messageAttributes', 'lambdakiq', 'stringValue') == '1'
end

#jobs?(event) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/lambdakiq/event.rb', line 4

def jobs?(event)
  records(event).any? { |r| job?(r) }
end

#records(event) ⇒ Object



12
13
14
# File 'lib/lambdakiq/event.rb', line 12

def records(event)
  event['Records'] || []
end