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)


8
9
10
# File 'lib/slack-ruby-bot/config.rb', line 8

def allow_message_loops?
  allow_message_loops
end

#reset!Object



18
19
20
# File 'lib/slack-ruby-bot/config.rb', line 18

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

#send_gifs?Boolean

Returns:

  • (Boolean)


12
13
14
15
16
# File 'lib/slack-ruby-bot/config.rb', line 12

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