Class: Prpr::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/prpr/runner.rb

Instance Method Summary collapse

Constructor Details

#initializeRunner

Returns a new instance of Runner.



3
4
5
# File 'lib/prpr/runner.rb', line 3

def initialize
  bundle
end

Instance Method Details

#bundleObject



12
13
14
15
# File 'lib/prpr/runner.rb', line 12

def bundle
  ::Bundler.require
rescue ::Bundler::GemfileNotFound
end

#call(payload, event:) ⇒ Object



7
8
9
10
# File 'lib/prpr/runner.rb', line 7

def call(payload, event:)
  e = Prpr::Event::Event.parse(payload, event: event)
  Prpr::Handler::Base.on_event e
end