Class: Lobster::Room

Inherits:
Object
  • Object
show all
Defined in:
lib/lobster/room.rb

Overview

Information about a chat room.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, creation) ⇒ Room

Creates information about a room.

Parameters:

  • id (Uuid)

    Unique room ID.

  • creation (Time)

    Date and time the room was created.


62
63
64
65
# File 'lib/lobster/room.rb', line 62

def initialize(id, creation)
  @id = id
  @creation = creation
end

Instance Attribute Details

#creationTime

Date and time the room was created.

Returns:

  • (Time)

45
46
47
# File 'lib/lobster/room.rb', line 45

def creation
  @creation
end

#descriptionString

Note:

The description of a room is publicly visible to everyone. The topic of the room is visible only to participants.

Publicly displayed room description.

Returns:

  • (String)

24
# File 'lib/lobster/room.rb', line 24

attr_type_accessor :description, String

#idUuid (readonly)

Unique ID of the room.

Returns:

  • (Uuid)

    ID of the room.


12
13
14
# File 'lib/lobster/room.rb', line 12

def id
  @id
end

#nameString

Publicly displayed name.

Returns:

  • (String)

17
# File 'lib/lobster/room.rb', line 17

attr_type_accessor :name, String

#owner_idUuid

ID of the room owner user.

Returns:


41
# File 'lib/lobster/room.rb', line 41

attr_type_accessor :owner_id, Uuid

#script_idUuid?

ID of the script running the room. This will be nil if there's no script running the room.

Returns:


36
# File 'lib/lobster/room.rb', line 36

attr_nullable_accessor :script_id, Uuid

#topicString?

Current topic in the room. Also known as the message of the day.

Returns:

  • (String, nil)

30
# File 'lib/lobster/room.rb', line 30

attr_nullable_accessor :topic, String

Instance Method Details

#hidden=(flag) ⇒ nil

Changes the visibility state of the room.

Parameters:

  • flag (Boolean)

    true if the room is hidden, or false if it is visible.

Returns:

  • (nil)

55
56
57
# File 'lib/lobster/room.rb', line 55

def hidden=(flag)
  @hidden = !!flag
end

#hidden?Boolean

Indicates whether the room is hidden to everyone except the participants.

Returns:

  • (Boolean)

48
49
50
# File 'lib/lobster/room.rb', line 48

def hidden?
  @hidden
end