Class: BotMob::Authority
- Inherits:
-
Object
- Object
- BotMob::Authority
- Defined in:
- lib/bot_mob/authority.rb
Overview
## BotMob::Authority
The Authority class will process an access code and retrieve an access token from Slack
Instance Attribute Summary collapse
-
#ambassador ⇒ Object
Returns the value of attribute ambassador.
-
#network ⇒ Object
Returns the value of attribute network.
Instance Method Summary collapse
-
#initialize(network, code) ⇒ Authority
constructor
A new instance of Authority.
- #process ⇒ Object
Constructor Details
#initialize(network, code) ⇒ Authority
9 10 11 |
# File 'lib/bot_mob/authority.rb', line 9 def initialize(network, code) @ambassador = BotMob::Ambassador.setup(network, code) end |
Instance Attribute Details
#ambassador ⇒ Object
Returns the value of attribute ambassador.
7 8 9 |
# File 'lib/bot_mob/authority.rb', line 7 def ambassador @ambassador end |
#network ⇒ Object
Returns the value of attribute network.
7 8 9 |
# File 'lib/bot_mob/authority.rb', line 7 def network @network end |
Instance Method Details
#process ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/bot_mob/authority.rb', line 13 def process return unless ambassador.success? install = Install.create_with_ambassador(ambassador) # check for install's success wire.publish(external_id: install.external_id) end |