Class: Balotelli::Core::PrivMsg
- Inherits:
-
Object
- Object
- Balotelli::Core::PrivMsg
- Defined in:
- lib/balotelli/core/priv_msg.rb
Instance Attribute Summary collapse
-
#channel ⇒ Object
readonly
Returns the value of attribute channel.
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#responder ⇒ Object
readonly
Returns the value of attribute responder.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
-
#user_nick ⇒ Object
readonly
Returns the value of attribute user_nick.
Instance Method Summary collapse
-
#initialize(metadata, privacy = false) ⇒ PrivMsg
constructor
A new instance of PrivMsg.
Constructor Details
#initialize(metadata, privacy = false) ⇒ PrivMsg
Returns a new instance of PrivMsg.
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/balotelli/core/priv_msg.rb', line 5 def initialize(, privacy = false) @user = [:user] @user_nick = @user.match(/\A(\S+)!.*/)[1] @channel = [:channel] @content = [:message] if privacy @responder = @user_nick else @responder = @channel end end |
Instance Attribute Details
#channel ⇒ Object (readonly)
Returns the value of attribute channel.
4 5 6 |
# File 'lib/balotelli/core/priv_msg.rb', line 4 def channel @channel end |
#content ⇒ Object (readonly)
Returns the value of attribute content.
4 5 6 |
# File 'lib/balotelli/core/priv_msg.rb', line 4 def content @content end |
#responder ⇒ Object (readonly)
Returns the value of attribute responder.
4 5 6 |
# File 'lib/balotelli/core/priv_msg.rb', line 4 def responder @responder end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
4 5 6 |
# File 'lib/balotelli/core/priv_msg.rb', line 4 def user @user end |
#user_nick ⇒ Object (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 |