Class: Textecho::Timecheck

Inherits:
Base
  • Object
show all
Defined in:
lib/textecho/timecheck.rb

Instance Attribute Summary

Attributes inherited from Base

#input_message, #locale, #msg_source, #output_list, #output_message, #params, #shortcode

Instance Method Summary collapse

Methods inherited from Base

#add_msg, #debug, #disabled_message, #handle_message, #help, #help_prefix, #msgs, #setup

Instance Method Details

#check_keywordObject



5
6
7
8
9
10
# File 'lib/textecho/timecheck.rb', line 5

def check_keyword()
  help_resp={"en"=>"send time to xxxx","te"=>"teturm: time to xxxx", "ba"=>"bahasa: time to xxxx"}
  out="Time is: #{Time.now.to_s}" if self.input_message.chomp=="time"
  out=self.help(help_resp) if self.input_message.chomp!="time"
  out
end

#processObject



11
12
13
14
15
16
# File 'lib/textecho/timecheck.rb', line 11

def process()
 self.output_message=check_keyword()
 puts "outbound message is "+ self.output_message if debug
 self.add_msg(self.output_message)
 self.msgs
end