Module: Chatroid::Adapter::Xmpp
- Defined in:
- lib/chatroid/adapter/xmpp.rb
Constant Summary collapse
- REQUIRED_CONFIG_KEYS =
[ :jid, :room, :nick, :password, ].freeze
- EVENT_NAMES =
[ :join, :leave, :message, :private_message, :room_message, :self_leave, :subject, ].freeze
- SLEEP_INTERVAL_SEC =
1
Class Method Summary collapse
Instance Method Summary collapse
- #ban(jid, reason = nil) ⇒ Object
- #demote(nick) ⇒ Object
- #exit(reason = nil) ⇒ Object
- #invite(jid, reason = nil) ⇒ Object
- #join(jid, password = nil) ⇒ Object
- #kick(nick, reason = nil) ⇒ Object
- #nick ⇒ Object
- #promote(nick) ⇒ Object
- #say(text) ⇒ Object
- #subject ⇒ Object
- #subject=(text) ⇒ Object
- #unban(jid) ⇒ Object
Class Method Details
.extended(chatroid) ⇒ Object
38 39 40 41 42 |
# File 'lib/chatroid/adapter/xmpp.rb', line 38 def self.extended(chatroid) REQUIRED_CONFIG_KEYS.each do |key| Avalon.validate(chatroid.config[key], String) end end |
Instance Method Details
#ban(jid, reason = nil) ⇒ Object
56 57 58 |
# File 'lib/chatroid/adapter/xmpp.rb', line 56 def ban(jid, reason = nil) room.ban(jid, reason) end |
#demote(nick) ⇒ Object
68 69 70 |
# File 'lib/chatroid/adapter/xmpp.rb', line 68 def demote(nick) room.demote(nick) end |
#exit(reason = nil) ⇒ Object
76 77 78 |
# File 'lib/chatroid/adapter/xmpp.rb', line 76 def exit(reason = nil) room.exit(reason) end |
#invite(jid, reason = nil) ⇒ Object
48 49 50 |
# File 'lib/chatroid/adapter/xmpp.rb', line 48 def invite(jid, reason = nil) room.invite(jid => reason) end |
#join(jid, password = nil) ⇒ Object
72 73 74 |
# File 'lib/chatroid/adapter/xmpp.rb', line 72 def join(jid, password = nil) room.join(jid, password) end |
#kick(nick, reason = nil) ⇒ Object
52 53 54 |
# File 'lib/chatroid/adapter/xmpp.rb', line 52 def kick(nick, reason = nil) room.kick(nick, reason) end |
#nick ⇒ Object
88 89 90 |
# File 'lib/chatroid/adapter/xmpp.rb', line 88 def nick room.nick end |
#promote(nick) ⇒ Object
64 65 66 |
# File 'lib/chatroid/adapter/xmpp.rb', line 64 def promote(nick) room.prompt(nick) end |
#say(text) ⇒ Object
44 45 46 |
# File 'lib/chatroid/adapter/xmpp.rb', line 44 def say(text) room.say(text) end |
#subject ⇒ Object
84 85 86 |
# File 'lib/chatroid/adapter/xmpp.rb', line 84 def subject room.subject end |
#subject=(text) ⇒ Object
80 81 82 |
# File 'lib/chatroid/adapter/xmpp.rb', line 80 def subject=(text) room.subject = text end |
#unban(jid) ⇒ Object
60 61 62 |
# File 'lib/chatroid/adapter/xmpp.rb', line 60 def unban(jid) room.unban(jid) end |