Class: Flamethrower::Campfire::User
- Inherits:
-
Object
- Object
- Flamethrower::Campfire::User
- Defined in:
- lib/flamethrower/campfire/user.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#number ⇒ Object
Returns the value of attribute number.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ User
constructor
A new instance of User.
- #to_irc ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ User
Returns a new instance of User.
6 7 8 9 |
# File 'lib/flamethrower/campfire/user.rb', line 6 def initialize(params = {}) @name = params['name'] @number = params['id'] end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/flamethrower/campfire/user.rb', line 4 def name @name end |
#number ⇒ Object
Returns the value of attribute number.
4 5 6 |
# File 'lib/flamethrower/campfire/user.rb', line 4 def number @number end |
Instance Method Details
#to_irc ⇒ Object
11 12 13 14 |
# File 'lib/flamethrower/campfire/user.rb', line 11 def to_irc nick = @name.gsub("\s", "_") @irc_user ||= Flamethrower::Irc::User.new(:username => nick, :nickname => nick, :hostname => 'campfirenow.com') end |