Class: DataDomeUser
- Inherits:
-
Object
- Object
- DataDomeUser
- Defined in:
- lib/model/user.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#email ⇒ Object
Returns the value of attribute email.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#id ⇒ Object
Returns the value of attribute id.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#phone ⇒ Object
Returns the value of attribute phone.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(id:, title: nil, first_name: nil, last_name: nil, created_at: Time.now.iso8601, phone: nil, email: nil, address: nil) ⇒ DataDomeUser
constructor
A new instance of DataDomeUser.
- #to_json(options = {}) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(id:, title: nil, first_name: nil, last_name: nil, created_at: Time.now.iso8601, phone: nil, email: nil, address: nil) ⇒ DataDomeUser
Returns a new instance of DataDomeUser.
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/model/user.rb', line 16 def initialize(id:, title: nil, first_name: nil, last_name: nil, created_at: Time.now.iso8601, phone: nil, email: nil, address: nil) @id = id @title = title @first_name = first_name @last_name = last_name @created_at = created_at @phone = phone @email = email @address = address end |
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
14 15 16 |
# File 'lib/model/user.rb', line 14 def address @address end |
#created_at ⇒ Object
Returns the value of attribute created_at.
14 15 16 |
# File 'lib/model/user.rb', line 14 def created_at @created_at end |
#email ⇒ Object
Returns the value of attribute email.
14 15 16 |
# File 'lib/model/user.rb', line 14 def email @email end |
#first_name ⇒ Object
Returns the value of attribute first_name.
14 15 16 |
# File 'lib/model/user.rb', line 14 def first_name @first_name end |
#id ⇒ Object
Returns the value of attribute id.
14 15 16 |
# File 'lib/model/user.rb', line 14 def id @id end |
#last_name ⇒ Object
Returns the value of attribute last_name.
14 15 16 |
# File 'lib/model/user.rb', line 14 def last_name @last_name end |
#phone ⇒ Object
Returns the value of attribute phone.
14 15 16 |
# File 'lib/model/user.rb', line 14 def phone @phone end |
#title ⇒ Object
Returns the value of attribute title.
14 15 16 |
# File 'lib/model/user.rb', line 14 def title @title end |
Instance Method Details
#to_json(options = {}) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/model/user.rb', line 31 def to_json( = {}) { id: @id, firstName: @first_name, lastName: @last_name, createdAt: @created_at, phone: @phone, email: @email, address: @address, }.to_json end |
#to_s ⇒ Object
27 28 29 |
# File 'lib/model/user.rb', line 27 def to_s "DataDomeUser: id=#{@id}, title=#{@title}, firstName=#{@first_name}, lastName=#{@last_name}, createdAt=#{@created_at}, phone=#{@phone}, address=#{@address}" end |