Class: Broadcast::Medium::Jabber::Client
- Inherits:
-
Object
- Object
- Broadcast::Medium::Jabber::Client
- Defined in:
- lib/broadcast/media/jabber.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
- #deliver(recipient, body) ⇒ Object
-
#initialize(username, password, server = nil, port = 5222) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(username, password, server = nil, port = 5222) ⇒ Client
9 10 11 12 13 14 |
# File 'lib/broadcast/media/jabber.rb', line 9 def initialize(username, password, server = nil, port = 5222) @jid = Jabber::JID::new(username) @client = Jabber::Client::new(@jid) client.connect(server, port) client.auth(password) end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
7 8 9 |
# File 'lib/broadcast/media/jabber.rb', line 7 def client @client end |
Instance Method Details
#deliver(recipient, body) ⇒ Object
16 17 18 |
# File 'lib/broadcast/media/jabber.rb', line 16 def deliver(recipient, body) client.send Jabber::Message::new(recipient, body) end |