Module: SlackRubyBot::Config

Extended by:
Config
Included in:
Config
Defined in:
lib/slack-ruby-bot/config.rb

Constant Summary collapse

ATTRS =
%i[token url aliases user user_id team team_id allow_message_loops send_gifs logger].freeze

Instance Method Summary collapse

Instance Method Details

#allow_message_loops?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/slack-ruby-bot/config.rb', line 10

def allow_message_loops?
  allow_message_loops
end

#reset!Object



21
22
23
# File 'lib/slack-ruby-bot/config.rb', line 21

def reset!
  ATTRS.each { |attr| send("#{attr}=", nil) }
end

#send_gifs?Boolean

Returns:

  • (Boolean)


14
15
16
17
18
19
# File 'lib/slack-ruby-bot/config.rb', line 14

def send_gifs?
  return false unless defined?(Giphy)

  v = boolean_from_env('SLACK_RUBY_BOT_SEND_GIFS')
  send_gifs.nil? ? (v.nil? || v) : send_gifs
end