Class: Flamethrower::Irc::User
- Inherits:
-
Object
- Object
- Flamethrower::Irc::User
- Defined in:
- lib/flamethrower/irc/user.rb
Instance Attribute Summary collapse
-
#away_message ⇒ Object
Returns the value of attribute away_message.
-
#hostname ⇒ Object
Returns the value of attribute hostname.
-
#modes ⇒ Object
Returns the value of attribute modes.
-
#nickname ⇒ Object
Returns the value of attribute nickname.
-
#realname ⇒ Object
Returns the value of attribute realname.
-
#servername ⇒ Object
Returns the value of attribute servername.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ User
constructor
A new instance of User.
- #mode ⇒ Object
- #nick_set? ⇒ Boolean
- #to_s ⇒ Object
- #user_set? ⇒ Boolean
Constructor Details
#initialize(options = {}) ⇒ User
Returns a new instance of User.
8 9 10 11 12 13 14 15 |
# File 'lib/flamethrower/irc/user.rb', line 8 def initialize(={}) @username = [:username] @nickname = [:nickname] @hostname = [:hostname] @realname = [:realname] @servername = [:servername] @modes = ["i"] end |
Instance Attribute Details
#away_message ⇒ Object
Returns the value of attribute away_message.
6 7 8 |
# File 'lib/flamethrower/irc/user.rb', line 6 def @away_message end |
#hostname ⇒ Object
Returns the value of attribute hostname.
5 6 7 |
# File 'lib/flamethrower/irc/user.rb', line 5 def hostname @hostname end |
#modes ⇒ Object
Returns the value of attribute modes.
5 6 7 |
# File 'lib/flamethrower/irc/user.rb', line 5 def modes @modes end |
#nickname ⇒ Object
Returns the value of attribute nickname.
5 6 7 |
# File 'lib/flamethrower/irc/user.rb', line 5 def nickname @nickname end |
#realname ⇒ Object
Returns the value of attribute realname.
5 6 7 |
# File 'lib/flamethrower/irc/user.rb', line 5 def realname @realname end |
#servername ⇒ Object
Returns the value of attribute servername.
5 6 7 |
# File 'lib/flamethrower/irc/user.rb', line 5 def servername @servername end |
#username ⇒ Object
Returns the value of attribute username.
5 6 7 |
# File 'lib/flamethrower/irc/user.rb', line 5 def username @username end |
Instance Method Details
#mode ⇒ Object
25 26 27 |
# File 'lib/flamethrower/irc/user.rb', line 25 def mode "+#{@modes.join}" end |
#nick_set? ⇒ Boolean
17 18 19 |
# File 'lib/flamethrower/irc/user.rb', line 17 def nick_set? !!@nickname end |
#to_s ⇒ Object
29 30 31 |
# File 'lib/flamethrower/irc/user.rb', line 29 def to_s "#{@nickname}!#{@username}@#{@hostname}" end |
#user_set? ⇒ Boolean
21 22 23 |
# File 'lib/flamethrower/irc/user.rb', line 21 def user_set? !!@username && !!@hostname && !!@realname && !!@servername end |