Class: User
Instance Attribute Summary collapse
-
#create_date ⇒ Object
readonly
Returns the value of attribute create_date.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#last_use_date ⇒ Object
readonly
Returns the value of attribute last_use_date.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(id, data = {}) ⇒ User
constructor
A new instance of User.
Methods inherited from HObject
Constructor Details
#initialize(id, data = {}) ⇒ User
Returns a new instance of User.
5 6 7 8 9 10 |
# File 'lib/lights/user.rb', line 5 def initialize( id, data = {} ) @id = id @name = data["name"] @create_date = data["create date"] @last_use_date = data["last use date"] end |
Instance Attribute Details
#create_date ⇒ Object (readonly)
Returns the value of attribute create_date.
4 5 6 |
# File 'lib/lights/user.rb', line 4 def create_date @create_date end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/lights/user.rb', line 4 def id @id end |
#last_use_date ⇒ Object (readonly)
Returns the value of attribute last_use_date.
4 5 6 |
# File 'lib/lights/user.rb', line 4 def last_use_date @last_use_date end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/lights/user.rb', line 4 def name @name end |
Instance Method Details
#data ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/lights/user.rb', line 12 def data data = {} data["name"] = @name if @name data["create date"] = @create_date if @create_date data["last use date"] = @last_use_date if @last_use_date data end |