Class: Typeking::User
- Inherits:
-
Object
- Object
- Typeking::User
- Defined in:
- lib/typeking/user.rb
Constant Summary collapse
- @@userCount =
0
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#uid ⇒ Object
readonly
Returns the value of attribute uid.
-
#userCount ⇒ Object
readonly
Returns the value of attribute userCount.
Instance Method Summary collapse
-
#initialize(name) ⇒ User
constructor
A new instance of User.
- #user_details ⇒ Object
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/typeking/user.rb', line 3 def name @name end |
#uid ⇒ Object (readonly)
Returns the value of attribute uid.
3 4 5 |
# File 'lib/typeking/user.rb', line 3 def uid @uid end |
#userCount ⇒ Object (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_details ⇒ Object
12 13 14 |
# File 'lib/typeking/user.rb', line 12 def user_details() {@name => @uid} end |