Class: Lita::Handlers::BitbucketPullrequest

Inherits:
Handler
  • Object
show all
Defined in:
lib/lita/handlers/bitbucket_pullrequest.rb

Instance Method Summary collapse

Instance Method Details

#receive(request, response) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/lita/handlers/bitbucket_pullrequest.rb', line 6

def receive(request, response)
  I18n.locale = Lita.config.robot.locale

  room = request.params['room']
  target = Source.new(room: room)
  data = parse(request.body.read)
  message = format(data)
  return if message.nil?
  robot.send_message(target, message)
end