Class: Lita::Extensions::Wizard
- Inherits:
-
Object
- Object
- Lita::Extensions::Wizard
- Defined in:
- lib/lita/extensions/wizard.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#robot ⇒ Object
readonly
Returns the value of attribute robot.
-
#route ⇒ Object
readonly
Returns the value of attribute route.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(payload) ⇒ Wizard
constructor
A new instance of Wizard.
Constructor Details
#initialize(payload) ⇒ Wizard
Returns a new instance of Wizard.
10 11 12 13 14 15 |
# File 'lib/lita/extensions/wizard.rb', line 10 def initialize(payload) @message = payload[:message] @route = payload[:route] @robot = payload[:robot] Lita.logger.debug "Initializing Lita::Extensions::Wizard with:\nMessage: #{.body}\nRoute: #{route.inspect}" end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
4 5 6 |
# File 'lib/lita/extensions/wizard.rb', line 4 def @message end |
#robot ⇒ Object (readonly)
Returns the value of attribute robot.
4 5 6 |
# File 'lib/lita/extensions/wizard.rb', line 4 def robot @robot end |
#route ⇒ Object (readonly)
Returns the value of attribute route.
4 5 6 |
# File 'lib/lita/extensions/wizard.rb', line 4 def route @route end |
Class Method Details
.call(payload) ⇒ Object
6 7 8 |
# File 'lib/lita/extensions/wizard.rb', line 6 def self.call(payload) new(payload).call end |
Instance Method Details
#call ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/lita/extensions/wizard.rb', line 17 def call if Lita.logger.debug "Handled by wizard: #{!!.extensions[:handled_by_wizard]}" Lita.logger.debug "Dummy route: #{route.extensions[:dummy] == true}" ret = compute_return_value Lita.logger.debug "Returning #{ret.inspect}" ret end |