Sha256: 0a280aa6e40918bf61eea280fcb97df304b519b1ca1cfee87bb3a70e9dfc8bf1

Contents?: true

Size: 1.44 KB

Versions: 3

Compression:

Stored size: 1.44 KB

Contents

module Slatan
  module Mouth
    module Channels
      @category = 'channels'

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

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

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

        ## @see https://api.slack.com/methods/channels.setPurpose
        def set_purpose(channel, purpose, options={})
          send('setPurpose', {
            channel: channel,
            purpose: purpose
          }.merge(options))
        end

        ## @see https://api.slack.com/methods/channels.setTopic
        def set_topic(channel, topic, options={})
          send('setTopic', {
            channel: channel,
            topic: topic
          }.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/channels.rb
slatan-0.2.0 lib/slatan/mouth/channels.rb
slatan-0.1.0 lib/slatan/mouth/channels.rb