Class: DataDomeUser

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, title: nil, first_name: nil, last_name: nil, created_at: nil, phone: nil, email: nil, display_name: nil, description: nil, picture_urls: nil, external_urls: nil, address: nil, payment_method_updated: nil) ⇒ DataDomeUser

Returns a new instance of DataDomeUser.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/model/user.rb', line 14

def initialize(id:, title: nil, first_name: nil, last_name: nil, created_at: nil, phone: nil, email: nil, display_name: nil, description: nil, picture_urls: nil, external_urls: nil, address: nil, payment_method_updated: nil)
  @id = id
  @title = title
  @first_name = first_name
  @last_name = last_name
  @created_at = created_at
  @phone = phone
  @email = email
  @display_name = display_name
  @description = description
  @picture_urls = picture_urls || []
  @external_urls = external_urls || []
  @address = address
  @payment_method_updated = payment_method_updated
end

Instance Attribute Details

#addressObject

Returns the value of attribute address.



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

def address
  @address
end

#created_atObject

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#descriptionObject

Returns the value of attribute description.



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

def description
  @description
end

#display_nameObject

Returns the value of attribute display_name.



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

def display_name
  @display_name
end

#emailObject

Returns the value of attribute email.



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

def email
  @email
end

#external_urlsObject

Returns the value of attribute external_urls.



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

def external_urls
  @external_urls
end

#first_nameObject

Returns the value of attribute first_name.



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

def first_name
  @first_name
end

#idObject

Returns the value of attribute id.



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

def id
  @id
end

#last_nameObject

Returns the value of attribute last_name.



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

def last_name
  @last_name
end

#payment_method_updatedObject

Returns the value of attribute payment_method_updated.



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

def payment_method_updated
  @payment_method_updated
end

#phoneObject

Returns the value of attribute phone.



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

def phone
  @phone
end

#picture_urlsObject

Returns the value of attribute picture_urls.



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

def picture_urls
  @picture_urls
end

#titleObject

Returns the value of attribute title.



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

def title
  @title
end

Instance Method Details

#to_json(options = {}) ⇒ Object



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/model/user.rb', line 34

def to_json(options = {})
  {
    id: @id,
    title: @title,
    firstName: @first_name,
    lastName: @last_name,
    createdAt: @created_at,
    phone: @phone,
    email: @email,
    displayName: @display_name,
    description: @description,
    pictureUrls: @picture_urls,
    externalUrls: @external_urls,
    address: @address.respond_to?(:to_json) ? JSON.parse(@address.to_json) : @address,
    paymentMethodUpdated: @payment_method_updated,
  }.to_json
end

#to_sObject



30
31
32
# File 'lib/model/user.rb', line 30

def to_s
  "DataDomeUser: id=#{@id}, title=#{@title}, firstName=#{@first_name}, lastName=#{@last_name}, createdAt=#{@created_at}, phone=#{@phone}, email=#{@email}, displayName=#{@display_name}, description=#{@description}, pictureUrls=#{@picture_urls}, externalUrls=#{@external_urls}, address=#{@address}, paymentMethodUpdated=#{@payment_method_updated}"
end