Class: Rype::Chat
- Inherits:
-
Object
- Object
- Rype::Chat
- Defined in:
- lib/rype/chat.rb
Class Attribute Summary collapse
-
.chats ⇒ Object
Returns the value of attribute chats.
Instance Attribute Summary collapse
-
#chatname ⇒ Object
readonly
Returns the value of attribute chatname.
Class Method Summary collapse
Instance Method Summary collapse
- #add_members(members) ⇒ Object
-
#initialize(chatname) ⇒ Chat
constructor
A new instance of Chat.
- #members(&block) ⇒ Object
- #send_message(message) ⇒ Object
- #topic(&block) ⇒ Object
Constructor Details
#initialize(chatname) ⇒ Chat
Returns a new instance of Chat.
20 21 22 |
# File 'lib/rype/chat.rb', line 20 def initialize(chatname) @chatname = chatname end |
Class Attribute Details
.chats ⇒ Object
Returns the value of attribute chats.
6 7 8 |
# File 'lib/rype/chat.rb', line 6 def chats @chats end |
Instance Attribute Details
#chatname ⇒ Object (readonly)
Returns the value of attribute chatname.
18 19 20 |
# File 'lib/rype/chat.rb', line 18 def chatname @chatname end |
Class Method Details
Instance Method Details
#add_members(members) ⇒ Object
38 39 40 |
# File 'lib/rype/chat.rb', line 38 def add_members(members) Api.invoke("ALTER CHAT #{@chatname} ADDMEMBERS #{members.join(' ')}") end |
#members(&block) ⇒ Object
32 33 34 35 36 |
# File 'lib/rype/chat.rb', line 32 def members(&block) get_property('MEMBERS') do |member_list| yield member_list.split(/ /) end end |
#send_message(message) ⇒ Object
24 25 26 |
# File 'lib/rype/chat.rb', line 24 def () Api.invoke("CHATMESSAGE #{@chatname} #{}") end |
#topic(&block) ⇒ Object
28 29 30 |
# File 'lib/rype/chat.rb', line 28 def topic(&block) get_property('TOPIC', &block) end |