Class: Rubot::Irc::Message

Inherits:
Object show all
Defined in:
lib/irc/message.rb

Overview

Represents an IRC message.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(from, destination, body) ⇒ Message

Initializes a new object with the given from, destination, and body.

Parameters

from<String>

The nick who sent the message

destination<String>

The destination where the reply to this message should be sent.

body<String>

The body of the message



27
28
29
30
31
# File 'lib/irc/message.rb', line 27

def initialize(from, destination, body)
  @from = from
  @destination = destination
  @body = body
end

Instance Attribute Details

#aliasObject

If the message was used to invoke a command, this will be the command name.



13
14
15
# File 'lib/irc/message.rb', line 13

def alias
  @alias
end

#authenticatedObject

If the user that sent this message is authenticated, this will be true.



16
17
18
# File 'lib/irc/message.rb', line 16

def authenticated
  @authenticated
end

#bodyObject

The body of the message.



10
11
12
# File 'lib/irc/message.rb', line 10

def body
  @body
end

#destinationObject

The location where the reply to this message should be sent. This defaults to the source of the message



7
8
9
# File 'lib/irc/message.rb', line 7

def destination
  @destination
end

#fromObject (readonly)

The user that sent this message.



19
20
21
# File 'lib/irc/message.rb', line 19

def from
  @from
end