Class: Rubeechat::InfoList::Buffer
- Inherits:
-
Object
- Object
- Rubeechat::InfoList::Buffer
- Defined in:
- lib/rubeechat/info_list.rb
Overview
a very cheezy implemenation of a buffer object
Instance Method Summary collapse
- #current_buffer? ⇒ Boolean
-
#initialize(ptr, hash) ⇒ Buffer
constructor
A new instance of Buffer.
-
#print(msg) ⇒ Object
print a message to this buffer.
- #server ⇒ Object
Constructor Details
#initialize(ptr, hash) ⇒ Buffer
Returns a new instance of Buffer.
7 8 9 10 |
# File 'lib/rubeechat/info_list.rb', line 7 def initialize(ptr, hash) @p = ptr @hash = hash end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *a, &b) ⇒ Object (private)
26 27 28 29 30 31 32 33 |
# File 'lib/rubeechat/info_list.rb', line 26 def method_missing(name, *a, &b) name = name.to_sym if @hash.has_key?(name) @hash[name] else super(name, *a, &b) end end |
Instance Method Details
#current_buffer? ⇒ Boolean
21 22 23 |
# File 'lib/rubeechat/info_list.rb', line 21 def current_buffer? current_buffer == 1 end |
#print(msg) ⇒ Object
print a message to this buffer
13 14 15 |
# File 'lib/rubeechat/info_list.rb', line 13 def print(msg) Weechat.print(@p, msg) end |
#server ⇒ Object
17 18 19 |
# File 'lib/rubeechat/info_list.rb', line 17 def server name.split('.').first end |