Class: User
- Inherits:
-
Object
- Object
- User
- Defined in:
- lib/lights/user.rb
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
-
#initialize(id, data = {}) ⇒ User
constructor
A new instance of User.
Constructor Details
#initialize(id, data = {}) ⇒ User
Returns a new instance of User.
4 5 6 7 8 9 10 11 |
# File 'lib/lights/user.rb', line 4 def initialize( id, data = {} ) puts data.inspect @id = id @data = data @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.
3 4 5 |
# File 'lib/lights/user.rb', line 3 def create_date @create_date end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/lights/user.rb', line 3 def id @id end |
#last_use_date ⇒ Object (readonly)
Returns the value of attribute last_use_date.
3 4 5 |
# File 'lib/lights/user.rb', line 3 def last_use_date @last_use_date end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/lights/user.rb', line 3 def name @name end |