Class: Tsclient::Profile

Inherits:
Object
  • Object
show all
Defined in:
lib/tsclient/profile.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from(data) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/tsclient/profile.rb', line 7

def self.from(data)
  with(
    identifier: data.dig("UserProfile", "LoginName"),
    name: data.dig("UserProfile", "DisplayName"),
    profile_pic_url: data.dig("UserProfile", "ProfilePicURL"),
    # We assume anyone with an email address as their SSO identifier is human
    human: data.dig("UserProfile", "LoginName")&.include?("@"),
    node: Node.from(data),
  )
end

Instance Method Details

#human?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/tsclient/profile.rb', line 18

def human?
  human
end