Class: ModSpox::Messages::Incoming::Whois
- Defined in:
- lib/mod_spox/messages/incoming/Whois.rb
Instance Attribute Summary collapse
-
#channels ⇒ Object
Channels user is found in.
-
#nick ⇒ Object
readonly
Nick of user.
-
#raw ⇒ Object
Raw whois string.
Attributes inherited from Message
Instance Method Summary collapse
-
#channels_push(channel) ⇒ Object
- channel
-
Channel Adds channel to list.
-
#initialize(nick) ⇒ Whois
constructor
A new instance of Whois.
-
#lock ⇒ Object
Locks the object’s custom methods.
-
#raw_push(string) ⇒ Object
- string
-
string Adds string to raw whois info.
Constructor Details
#initialize(nick) ⇒ Whois
Returns a new instance of Whois.
13 14 15 16 17 18 |
# File 'lib/mod_spox/messages/incoming/Whois.rb', line 13 def initialize(nick) @nick = nick @channels = Array.new @raw = Array.new @locked = false end |
Instance Attribute Details
#channels ⇒ Object
Channels user is found in
9 10 11 |
# File 'lib/mod_spox/messages/incoming/Whois.rb', line 9 def channels @channels end |
#nick ⇒ Object (readonly)
Nick of user
7 8 9 |
# File 'lib/mod_spox/messages/incoming/Whois.rb', line 7 def nick @nick end |
#raw ⇒ Object
Raw whois string
11 12 13 |
# File 'lib/mod_spox/messages/incoming/Whois.rb', line 11 def raw @raw end |
Instance Method Details
#channels_push(channel) ⇒ Object
- channel
-
Channel
Adds channel to list
22 23 24 25 |
# File 'lib/mod_spox/messages/incoming/Whois.rb', line 22 def channels_push(channel) restricted if @locked @channels << channel end |
#lock ⇒ Object
Locks the object’s custom methods
35 36 37 38 39 |
# File 'lib/mod_spox/messages/incoming/Whois.rb', line 35 def lock @locked = true @raw_content = @raw.join("\n") @nick.refresh end |
#raw_push(string) ⇒ Object
- string
-
string
Adds string to raw whois info
29 30 31 32 |
# File 'lib/mod_spox/messages/incoming/Whois.rb', line 29 def raw_push(string) restricted if @locked @raw << string end |