Class: Pipio::AutoOrXmlMessageCreator

Inherits:
Object
  • Object
show all
Defined in:
lib/pipio/message_creators/auto_or_xml_message_creator.rb

Instance Method Summary collapse

Constructor Details

#initialize(text, time, sender_screen_name, sender_alias, is_auto_reply) ⇒ AutoOrXmlMessageCreator

Returns a new instance of AutoOrXmlMessageCreator.



3
4
5
6
7
8
9
# File 'lib/pipio/message_creators/auto_or_xml_message_creator.rb', line 3

def initialize(text, time, sender_screen_name, sender_alias, is_auto_reply)
  @text = text
  @time = time
  @sender_screen_name = sender_screen_name
  @sender_alias = sender_alias
  @is_auto_reply = is_auto_reply
end

Instance Method Details

#createObject



11
12
13
14
15
16
17
# File 'lib/pipio/message_creators/auto_or_xml_message_creator.rb', line 11

def create
  if auto_reply?
    AutoReplyMessage.new(@sender_screen_name, @time, @sender_alias, @text)
  else
    XMLMessage.new(@sender_screen_name, @time, @sender_alias, @text)
  end
end