Class: WitBot::Bot::Message

Inherits:
Message
  • Object
show all
Defined in:
lib/wit_bot/bot/models/message.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_hash(thread, id, json) ⇒ Object



11
12
13
# File 'lib/wit_bot/bot/models/message.rb', line 11

def self.from_hash(thread, id, json)
  self.new(thread, json[:text], id: id).from_hash json
end

Instance Method Details

#bot? ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/wit_bot/bot/models/message.rb', line 4

def bot?
  true
end

#from_hash(json) ⇒ Object



7
8
9
10
# File 'lib/wit_bot/bot/models/message.rb', line 7

def from_hash(json)
  @_text = json[:_text]
  self
end

#send ⇒ Object



14
15
16
# File 'lib/wit_bot/bot/models/message.rb', line 14

def send
  throw "You can't send a bot message."
end