Class: Weechat::IRC::Server
- Inherits:
-
Object
- Object
- Weechat::IRC::Server
show all
- Extended by:
- Properties
- Defined in:
- lib/weechat/server.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
#all, #apply_rtransformation, #apply_transformation, #init_properties, #known_integer_properties, #known_properties, #known_string_properties, #mappings, #rtransformations, #settable_properties, #transformations, #type
Constructor Details
#initialize(*args) ⇒ Server
Returns a new instance of Server.
49
50
51
|
# File 'lib/weechat/server.rb', line 49
def initialize(*args)
end
|
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
9
10
11
|
# File 'lib/weechat/server.rb', line 9
def name
@name
end
|
#ptr ⇒ Object
Returns the value of attribute ptr.
48
49
50
|
# File 'lib/weechat/server.rb', line 48
def ptr
@ptr
end
|
Class Method Details
.all ⇒ Object
64
65
66
67
68
69
70
|
# File 'lib/weechat/server.rb', line 64
def all
servers = []
Weechat::Infolist.parse("irc_server").each do |server|
servers << Server.from_name(server[:name])
end
servers
end
|
.find(name) ⇒ Object
Also known as:
from_name
72
73
74
75
76
77
78
|
# File 'lib/weechat/server.rb', line 72
def find(name)
o = allocate
o.instance_variable_set(:@ptr, name)
o.instance_variable_set(:@name, name.to_s)
raise Exception::UnknownServer, name if o.get_infolist.empty?
o
end
|
Instance Method Details
#==(other) ⇒ Object
Also known as:
eql?, equal?
53
54
55
|
# File 'lib/weechat/server.rb', line 53
def ==(other)
@ptr == other.ptr
end
|
44
45
46
|
# File 'lib/weechat/server.rb', line 44
def autojoin?
!disable_autojoin
end
|
#channels ⇒ Object
82
83
84
85
86
87
88
|
# File 'lib/weechat/server.rb', line 82
def channels
channels = []
Weechat::Infolist.parse("irc_channel", "", @name).each do |channel|
channels << IRC::Channel.new(channel[:buffer])
end
channels
end
|
#connect ⇒ Object
90
91
92
93
|
# File 'lib/weechat/server.rb', line 90
def connect
return false if connected?
Weechat.exec("/connect #{@name}")
end
|
#disconnect ⇒ Object
95
96
97
98
|
# File 'lib/weechat/server.rb', line 95
def disconnect
return false if not connected?
self.buffer.exec("/disconnect #{@name}")
end
|
#hash ⇒ Object
59
60
61
|
# File 'lib/weechat/server.rb', line 59
def hash
@ptr.hash
end
|