Sha256: 43001d0d4eeac444bbb732966cc1b79cce81cc26523abb1ef14a71df7c4dbb84

Contents?: true

Size: 410 Bytes

Versions: 4

Compression:

Stored size: 410 Bytes

Contents

module Slappy
  class Configuration
    attr_accessor :username, :botname, :token, :icon_emoji, :channel, :icon_url

    def botname
      @botname || username
    end

    def token
      @token || ENV['SLACK_TOKEN']
    end

    def username
      @username || 'slappy'
    end

    def send_params
      { username: username, icon_emoji: icon_emoji, channel: channel, icon_url: icon_url }
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
slappy-0.2.1 lib/slappy/configuration.rb
slappy-0.2.0 lib/slappy/configuration.rb
slappy-0.1.1 lib/slappy/configuration.rb
slappy-0.1.0 lib/slappy/configuration.rb