Class: Lobster::Profile

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

Overview

Information about a user that may or may not be connected to the server.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id) ⇒ Profile

Creates the user profile.

Parameters:

  • id (Uuid)

    Unique ID of the user the profile is about.



52
53
54
55
56
# File 'lib/lobster/profile.rb', line 52

def initialize(id)
  fail ArgumentError unless id.is_a?(Uuid)

  @id = id
end

Instance Attribute Details

#aliasString

Publicly displayed username. This is the name displayed to all other users and can differ from the login name.

Returns:

  • (String)


18
# File 'lib/lobster/profile.rb', line 18

attr_type_accessor :alias, String

#avatar_idUuid

ID of the resource representing the user's avatar image.

Returns:



43
# File 'lib/lobster/profile.rb', line 43

attr_type_accessor :avatar_id, Uuid

#coinsFixnum

Number of coins the user has accumulated in their pocketses.

Returns:

  • (Fixnum)


48
# File 'lib/lobster/profile.rb', line 48

attr_type_accessor :coins, Fixnum

#colorFixnum

Color used to display the alias.

Returns:

  • (Fixnum)

    24-bit integer representation as RGB (8-bits per channel).



23
# File 'lib/lobster/profile.rb', line 23

attr_type_accessor :color, Fixnum

#idUuid (readonly)

Unique ID of the user the profile is about.

Returns:



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

def id
  @id
end

#loginTime

Date and time when the user last logged in.

Returns:

  • (Time)


33
# File 'lib/lobster/profile.rb', line 33

attr_type_accessor :login, Time

#quoteString

Custom message displayed with the user's profile.

Returns:

  • (String)


38
# File 'lib/lobster/profile.rb', line 38

attr_type_accessor :quote, String

#registrationTime?

Date and time the user registered.

Returns:

  • (Time, nil)

    nil will be returned if the user is a guest (hasn't registered).



28
# File 'lib/lobster/profile.rb', line 28

attr_type_accessor :registration, Time