Class: ChatBot::GroupMeMessage

Inherits:
Object
  • Object
show all
Includes:
Commandable
Defined in:
lib/chatbot/groupme_message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Commandable

#body, #command, #is_command?

Constructor Details

#initialize(message, sender, sender_id) ⇒ GroupMeMessage

Returns a new instance of GroupMeMessage.



7
8
9
10
11
12
13
14
15
16
# File 'lib/chatbot/groupme_message.rb', line 7

def initialize(message, sender, sender_id)
  begin
    sender = sender.to_str
  rescue NoMethodError
    raise ArgumentError, "expected sender to be string"
  end
  @message = message || ""
  @sender = sender
  @sender_id = sender_id
end

Instance Attribute Details

#messageObject (readonly)

Returns the value of attribute message.



5
6
7
# File 'lib/chatbot/groupme_message.rb', line 5

def message
  @message
end

#senderObject (readonly)

Returns the value of attribute sender.



5
6
7
# File 'lib/chatbot/groupme_message.rb', line 5

def sender
  @sender
end

#sender_idObject (readonly)

Returns the value of attribute sender_id.



5
6
7
# File 'lib/chatbot/groupme_message.rb', line 5

def sender_id
  @sender_id
end