Class: Slackbotsy::Message
- Inherits:
-
Hash
- Object
- Hash
- Slackbotsy::Message
- Defined in:
- lib/slackbotsy/message.rb
Instance Method Summary collapse
-
#initialize(caller, msg) ⇒ Message
constructor
convert message from a Hash obj to a Message obj.
-
#say(text, options = {}) ⇒ Object
call say without bot object.
Constructor Details
#initialize(caller, msg) ⇒ Message
convert message from a Hash obj to a Message obj
6 7 8 9 10 |
# File 'lib/slackbotsy/message.rb', line 6 def initialize(caller, msg) super() self.update(msg) @caller = caller # bot object end |
Instance Method Details
#say(text, options = {}) ⇒ Object
call say without bot object
13 14 15 16 |
# File 'lib/slackbotsy/message.rb', line 13 def say(text, = {}) [:channel] ||= self['channel_name'] # default to same channel as msg @caller.say(text, ) end |