Sha256: 32af86ec97d1f2db9d6e39e5293db06cc8431ccd5f33b189b17ba923ccf1a92c

Contents?: true

Size: 931 Bytes

Versions: 3

Compression:

Stored size: 931 Bytes

Contents

module Slatan
  module Mouth
    module Chat
      @category = 'chat'

      class << self
        ## @see https://api.slack.com/methods/chat.postMessage
        def post_message(channel, text, options={})
          send('postMessage', {
            channel: channel,
            text: text
          }.merge(options))
        end

        ## @see https://api.slack.com/methods/chat.update
        def update(ts, channel, text, options={})
          send('update', {
            ts: ts,
            channel: channel,
            text: text
          }.merge(options))
        end

        ## @see https://api.slack.com/methods/chat.delete
        def delete(channel, ts, options={})
          send('delete', {
            ts: ts,
            channel: channel
          }.merge(options))
        end

        private
        def send(method, msg)
          Mouth.send(@category, method, msg)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
slatan-0.2.2 lib/slatan/mouth/chat.rb
slatan-0.2.0 lib/slatan/mouth/chat.rb
slatan-0.1.0 lib/slatan/mouth/chat.rb