Class: Nanobot::Config::SlackConfig
- Inherits:
-
Struct
- Object
- Struct
- Nanobot::Config::SlackConfig
- Defined in:
- lib/nanobot/config/schema.rb
Overview
Slack channel configuration
Instance Attribute Summary collapse
-
#app_token ⇒ Object
Returns the value of attribute app_token.
-
#bot_token ⇒ Object
Returns the value of attribute bot_token.
-
#dm ⇒ Object
Returns the value of attribute dm.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#group_allow_from ⇒ Object
Returns the value of attribute group_allow_from.
-
#group_policy ⇒ Object
Returns the value of attribute group_policy.
Instance Method Summary collapse
-
#initialize(enabled: false, bot_token: nil, app_token: nil, group_policy: 'mention', group_allow_from: [], dm: {}) ⇒ SlackConfig
constructor
A new instance of SlackConfig.
Constructor Details
#initialize(enabled: false, bot_token: nil, app_token: nil, group_policy: 'mention', group_allow_from: [], dm: {}) ⇒ SlackConfig
Returns a new instance of SlackConfig.
175 176 177 178 179 180 181 182 183 184 185 |
# File 'lib/nanobot/config/schema.rb', line 175 def initialize( enabled: false, bot_token: nil, app_token: nil, group_policy: 'mention', group_allow_from: [], dm: {} ) dm_config = dm.is_a?(Hash) ? dm : {} super( enabled: enabled, bot_token: bot_token, app_token: app_token, group_policy: group_policy, group_allow_from: group_allow_from, dm: SlackDMConfig.new(**dm_config) ) end |
Instance Attribute Details
#app_token ⇒ Object
Returns the value of attribute app_token
165 166 167 |
# File 'lib/nanobot/config/schema.rb', line 165 def app_token @app_token end |
#bot_token ⇒ Object
Returns the value of attribute bot_token
165 166 167 |
# File 'lib/nanobot/config/schema.rb', line 165 def bot_token @bot_token end |
#dm ⇒ Object
Returns the value of attribute dm
165 166 167 |
# File 'lib/nanobot/config/schema.rb', line 165 def dm @dm end |
#enabled ⇒ Object
Returns the value of attribute enabled
165 166 167 |
# File 'lib/nanobot/config/schema.rb', line 165 def enabled @enabled end |
#group_allow_from ⇒ Object
Returns the value of attribute group_allow_from
165 166 167 |
# File 'lib/nanobot/config/schema.rb', line 165 def group_allow_from @group_allow_from end |
#group_policy ⇒ Object
Returns the value of attribute group_policy
165 166 167 |
# File 'lib/nanobot/config/schema.rb', line 165 def group_policy @group_policy end |