Class: Flamethrower::Campfire::User

Inherits:
Object
  • Object
show all
Defined in:
lib/flamethrower/campfire/user.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/flamethrower/campfire/user.rb', line 4

def name
  @name
end

#numberObject

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_ircObject



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