Sha256: 687725c7dd6e512cc78c65f780041a9f5e3aa83e3c1ff439a76435db2fddd1b0

Contents?: true

Size: 663 Bytes

Versions: 5

Compression:

Stored size: 663 Bytes

Contents

require "messenger/bot/version"
require "messenger/bot/config"
require "messenger/bot/request"
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

5 entries across 5 versions & 1 rubygems

Version Path
messenger-bot-1.0.2 lib/messenger/bot.rb
messenger-bot-1.0.0 lib/messenger/bot.rb
messenger-bot-0.1.9 lib/messenger/bot.rb
messenger-bot-0.1.8 lib/messenger/bot.rb
messenger-bot-0.1.7 lib/messenger/bot.rb