Class: Pepito::Source

Inherits:
Object
  • Object
show all
Defined in:
lib/pepito/source.rb

Overview

Source for a message, where it comes from, where it should go

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(adapter, user, room, private_message) ⇒ void

Parameters:

  • adapter (Adapter)

    The adapter that received the message.

  • user (String)

    The user that sent the message.

  • room (String)

    The room where the message was sent from.

  • private_message (Boolean)

    Whether the message is private or not.



25
26
27
28
29
30
# File 'lib/pepito/source.rb', line 25

def initialize(adapter, user, room, private_message)
  @adapter = adapter
  @user = user
  @room = room
  @private_message = private_message
end

Instance Attribute Details

#adapterPepito::Adapter (readonly)

Adapter that received the message.

Returns:



6
7
8
# File 'lib/pepito/source.rb', line 6

def adapter
  @adapter
end

#private_messageBoolean (readonly)

Whether the message is private or not

Returns:

  • (Boolean)


18
19
20
# File 'lib/pepito/source.rb', line 18

def private_message
  @private_message
end

#roomString (readonly)

Room where the message originated

Returns:

  • (String)


14
15
16
# File 'lib/pepito/source.rb', line 14

def room
  @room
end

#userString (readonly)

User that sent the message.

Returns:

  • (String)


10
11
12
# File 'lib/pepito/source.rb', line 10

def user
  @user
end