Module: BotMob
- Defined in:
- lib/bot_mob.rb,
lib/bot_mob/bot.rb,
lib/bot_mob/wire.rb,
lib/bot_mob/slack.rb,
lib/bot_mob/errors.rb,
lib/bot_mob/roster.rb,
lib/bot_mob/install.rb,
lib/bot_mob/version.rb,
lib/bot_mob/authority.rb,
lib/bot_mob/ambassador.rb,
lib/bot_mob/connection.rb,
lib/bot_mob/application.rb,
lib/bot_mob/nil_connection.rb,
lib/bot_mob/inbound_message.rb,
lib/bot_mob/outbound_message.rb,
lib/bot_mob/slack/ambassador.rb,
lib/bot_mob/slack/connection.rb,
lib/bot_mob/slack/inbound_message.rb,
lib/bot_mob/development/ambassador.rb,
lib/bot_mob/development/connection.rb,
lib/bot_mob/development/inbound_message.rb
Overview
## BotMob
BotMob provides all the tools you need to easily connect multiple bots to chat networks
Defined Under Namespace
Modules: Development, Slack
Classes: Ambassador, Application, Authority, Bot, Connection, ConnectionNotEstablished, InboundMessage, Install, InvalidAmbassadorError, InvalidClientIdError, InvalidClientSecretError, InvalidCodeError, InvalidConnectionError, InvalidInboundMessageError, InvalidNetworkError, NilConnection, OutboundMessage, Roster, UnregisteredBotError, Wire
Constant Summary
collapse
- VERSION =
'0.2.2'.freeze
- @@networks =
{
dev: BotMob::Development
}
Class Method Summary
collapse
Class Method Details
.logger ⇒ Object
48
49
50
51
52
53
54
55
56
57
|
# File 'lib/bot_mob.rb', line 48
def self.logger
@logger ||= begin
buffer = Logger.new(ENV['RACK_ENV'] == 'test' ? '/dev/null' : STDOUT)
if buffer
buffer.level = ($PROGRAM_NAME == 'irb' ? Logger::DEBUG : Logger::INFO)
buffer.formatter = proc { |severity, datetime, progname, msg| "#{msg}\n" }
end
buffer
end
end
|
.mount(network_map) ⇒ Object
36
37
38
|
# File 'lib/bot_mob.rb', line 36
def self.mount(network_map)
@@networks.merge!(network_map)
end
|
.networks ⇒ Object
32
33
34
|
# File 'lib/bot_mob.rb', line 32
def self.networks
@@networks
end
|
.root ⇒ Object
44
45
46
|
# File 'lib/bot_mob.rb', line 44
def self.root
File.expand_path('../..', __FILE__)
end
|
.valid_network?(network) ⇒ Boolean
40
41
42
|
# File 'lib/bot_mob.rb', line 40
def self.valid_network?(network)
networks.include?(network.to_s.to_sym) && BotMob.networks[network]
end
|