Category: engineering

Building a Slack bot with Sinatra

I’m going to build a Slack bot which triggers by keyword, performs some action and sends a response back to Slack. During the work I will keep two rules in mind:

  1. Bot code should be as simple as possible;
  2. Bot should be extensible by plugins.

The bot will be built with Sinatra and deployed to Heroku. No database or background worker is needed.

Continue reading →

Passing options to included modules

One of the tasks I’ve faced recently was to allow configuring a module, included into multiple classes, by passing options (simple key => value hash) to it. The traditional approach would be using class or instance variables/accessors or so, but this time I decided to try something different.

Continue reading →