Class: GoogleChat
Instance Method Summary collapse
-
#initialize(user, password, resource = 'Resource') ⇒ GoogleChat
constructor
A new instance of GoogleChat.
- #send(message, to) ⇒ Object
Constructor Details
#initialize(user, password, resource = 'Resource') ⇒ GoogleChat
Returns a new instance of GoogleChat.
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/google_chat.rb', line 8 def initialize(user, password, resource='Resource') jid = JID::new("#{user}/#{resource}") @client = Client::new(jid) @client.use_ssl = true begin @client.connect('talk.google.com', 443) @client.auth(password) return @self rescue Exception => e puts e. end end |
Instance Method Details
#send(message, to) ⇒ Object
22 23 24 |
# File 'lib/google_chat.rb', line 22 def send(,to) @client.send Message::new(to, ).set_type(:normal).set_id('1') end |