Class: Hg::Assistant::Bot
- Inherits:
-
Object
- Object
- Hg::Assistant::Bot
- Extended by:
- Dry::Configurable
- Defined in:
- lib/hg/assistant/bot.rb
Class Method Summary collapse
- .configure {|config| ... } ⇒ Object
-
.router ⇒ Class
The bot's router class.
- .user_class ⇒ Object
- .user_context_field ⇒ Object
Class Method Details
.configure {|config| ... } ⇒ Object
16 17 18 |
# File 'lib/hg/assistant/bot.rb', line 16 def configure(&block) yield config end |
.router ⇒ Class
Returns The bot's router class.
21 22 23 24 25 |
# File 'lib/hg/assistant/bot.rb', line 21 def router config.router_class ||= const_get(:Router) rescue LoadError raise NoRouterClassExistsError.new end |
.user_class ⇒ Object
27 28 29 30 |
# File 'lib/hg/assistant/bot.rb', line 27 def user_class # TODO: Ensure config returns default user_class config.user_class || Kernel.const_get(:User) end |
.user_context_field ⇒ Object
32 33 34 |
# File 'lib/hg/assistant/bot.rb', line 32 def user_context_field config.user_context_field || :context end |