Class: Iter::User

Inherits:
Resource show all
Defined in:
lib/iter/user.rb

Overview

Provides methods to interact with Iterable users.

Constant Summary collapse

PATH =
'/api/v1/data/Clients/'

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:) ⇒ User

Returns a new instance of User.



8
9
10
# File 'lib/iter/user.rb', line 8

def initialize(id:)
  @id = id
end

Instance Attribute Details

#emailObject (readonly)

Returns the value of attribute email.



6
7
8
# File 'lib/iter/user.rb', line 6

def email
  @email
end

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/iter/user.rb', line 6

def id
  @id
end

Class Method Details

.update(email:, fields:) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/iter/user.rb', line 13

def self.update(email:, fields:)
  body = {
    userId: id,
    email: email,
    dataFields: fields,
  }

  data = request path: '/api/users/update', body: body

  email = value_for_field data, 238
  new id: contact_id, email: email
end