Sha256: 54d2e2a80336d3ebef843f275a704a5e8008923760fc635bdd02355a52d37deb

Contents?: true

Size: 631 Bytes

Versions: 3

Compression:

Stored size: 631 Bytes

Contents

require "messenger/bot/version"
require "messenger/bot/config"
require "messenger/bot/transmitter"
require "messenger/bot/receiver"

module Messenger
  module Bot
    def self.config(&block)
      if block_given?
        block.call(Messenger::Bot::Config)
      else
        Messenger::Bot::Config
      end
    end

    def self.on(event, &block)
      if %w(message postback delivery).include?(event)
        if block_given?
          Messenger::Bot::Receiver.define_event(event, &block)
        end
      else
        raise "'#{event}' Not support event."
      end
    end

    autoload :Space, "messenger/bot/space"
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
messenger-bot-0.1.6 lib/messenger/bot.rb
messenger-bot-0.1.5 lib/messenger/bot.rb
messenger-bot-0.1.4 lib/messenger/bot.rb