Class: Hipbot::Response
- Inherits:
-
Struct
- Object
- Struct
- Hipbot::Response
- Includes:
- Helpers
- Defined in:
- lib/hipbot/response.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
Returns the value of attribute message.
-
#reaction ⇒ Object
Returns the value of attribute reaction.
Instance Method Summary collapse
-
#initialize(*_) ⇒ Response
constructor
A new instance of Response.
- #invoke(arguments) ⇒ Object
- #reply(message, room = self.room) ⇒ Object
Constructor Details
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object (protected)
32 33 34 |
# File 'lib/hipbot/response.rb', line 32 def method_missing method, *args, &block plugin.send(method, *args, &block) end |
Instance Attribute Details
#message ⇒ Object
Returns the value of attribute message
2 3 4 |
# File 'lib/hipbot/response.rb', line 2 def @message end |
#reaction ⇒ Object
Returns the value of attribute reaction
2 3 4 |
# File 'lib/hipbot/response.rb', line 2 def reaction @reaction end |
Instance Method Details
#invoke(arguments) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/hipbot/response.rb', line 13 def invoke arguments handle_errors do instance_exec(*arguments, &reaction.block) end rescue Exception => e instance_exec(e, &Hipbot.exception_handler) end |
#reply(message, room = self.room) ⇒ Object
21 22 23 |
# File 'lib/hipbot/response.rb', line 21 def reply , room = self.room (room || sender).() end |