module SlackRubyBot::Config

Attributes

aliases[RW]
allow_message_loops[RW]
send_gifs[RW]
team[RW]
team_id[RW]
token[RW]
url[RW]
user[RW]
user_id[RW]

Public Instance Methods

allow_message_loops?() click to toggle source
# File lib/slack-ruby-bot/config.rb, line 15
def allow_message_loops?
  allow_message_loops
end
send_gifs?() click to toggle source
# File lib/slack-ruby-bot/config.rb, line 19
def send_gifs?
  v = boolean_from_env('SLACK_RUBY_BOT_SEND_GIFS')
  v.nil? ? (send_gifs.nil? || send_gifs) : v
end

Private Instance Methods

boolean_from_env(key) click to toggle source
# File lib/slack-ruby-bot/config.rb, line 26
def boolean_from_env(key)
  value = ENV[key]
  case value
  when nil
    nil
  when 0, 'false', 'no'
    false
  when 1, 'true', 'yes'
    true
  else
    fail ArgumentError, "Invalid value for #{key}: #{value}."
  end
end