Class: Typeking::User

Inherits:
Object
  • Object
show all
Defined in:
lib/typeking/user.rb

Constant Summary collapse

@@userCount =
0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ User

Returns a new instance of User.



6
7
8
9
10
# File 'lib/typeking/user.rb', line 6

def initialize(name)
    @name = name
    @uid = @@userCount
    @@userCount +=1
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/typeking/user.rb', line 3

def name
  @name
end

#uidObject (readonly)

Returns the value of attribute uid.



3
4
5
# File 'lib/typeking/user.rb', line 3

def uid
  @uid
end

#userCountObject (readonly)

Returns the value of attribute userCount.



3
4
5
# File 'lib/typeking/user.rb', line 3

def userCount
  @userCount
end

Instance Method Details

#user_detailsObject



12
13
14
# File 'lib/typeking/user.rb', line 12

def user_details()
    {@name => @uid}
end