Class: Balotelli::Core::PrivMsg

Inherits:
Object
  • Object
show all
Defined in:
lib/balotelli/core/priv_msg.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user, channel, message, privacy = false) ⇒ PrivMsg

Returns a new instance of PrivMsg.



5
6
7
8
9
10
11
# File 'lib/balotelli/core/priv_msg.rb', line 5

def initialize(user, channel, message, privacy = false)
  @user = user
  @user_nick = @user.match(/\A(\S+)!.*/)[1]
  @channel = channel
  @content = message
  @responder = privacy ? @user_nick : @channel
end

Instance Attribute Details

#channelObject (readonly)

Returns the value of attribute channel.



4
5
6
# File 'lib/balotelli/core/priv_msg.rb', line 4

def channel
  @channel
end

#contentObject (readonly)

Returns the value of attribute content.



4
5
6
# File 'lib/balotelli/core/priv_msg.rb', line 4

def content
  @content
end

#responderObject (readonly)

Returns the value of attribute responder.



4
5
6
# File 'lib/balotelli/core/priv_msg.rb', line 4

def responder
  @responder
end

#userObject (readonly)

Returns the value of attribute user.



4
5
6
# File 'lib/balotelli/core/priv_msg.rb', line 4

def user
  @user
end

#user_nickObject (readonly)

Returns the value of attribute user_nick.



4
5
6
# File 'lib/balotelli/core/priv_msg.rb', line 4

def user_nick
  @user_nick
end