Class: SlackRubyBot::App
- Inherits:
-
Object
- Object
- SlackRubyBot::App
- Includes:
- Hooks::Hello, Hooks::Message
- Defined in:
- lib/slack-ruby-bot/app.rb
Class Method Summary collapse
Instance Method Summary collapse
- #config ⇒ Object
-
#initialize ⇒ App
constructor
A new instance of App.
- #run ⇒ Object
- #stop! ⇒ Object
Methods included from Hooks::Message
Methods included from Hooks::Base
Methods included from Hooks::Hello
Constructor Details
#initialize ⇒ App
Returns a new instance of App.
8 9 10 11 12 13 14 15 16 |
# File 'lib/slack-ruby-bot/app.rb', line 8 def initialize SlackRubyBot.configure do |config| config.token = ENV['SLACK_API_TOKEN'] || fail("Missing ENV['SLACK_API_TOKEN'].") config.aliases = ENV['SLACK_RUBY_BOT_ALIASES'].split(' ') if ENV['SLACK_RUBY_BOT_ALIASES'] end Slack.configure do |config| config.token = SlackRubyBot.config.token end end |
Class Method Details
.instance ⇒ Object
22 23 24 |
# File 'lib/slack-ruby-bot/app.rb', line 22 def self.instance @instance ||= SlackRubyBot::App.new end |
Instance Method Details
#config ⇒ Object
18 19 20 |
# File 'lib/slack-ruby-bot/app.rb', line 18 def config SlackRubyBot.config end |
#run ⇒ Object
26 27 28 29 |
# File 'lib/slack-ruby-bot/app.rb', line 26 def run auth! start! end |
#stop! ⇒ Object
31 32 33 |
# File 'lib/slack-ruby-bot/app.rb', line 31 def stop! client.stop end |