Class: Slackbotsy::Message

Inherits:
Hash
  • Object
show all
Defined in:
lib/slackbotsy/message.rb

Instance Method Summary collapse

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, options = {})
  options[:channel] ||= self['channel_name'] # default to same channel as msg
  @caller.say(text, options)
end