Class: VSTS::Identity

Inherits:
BaseModel show all
Defined in:
lib/vsts/identity.rb

Overview

User (person) model

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#underscore

Constructor Details

#initialize(identity_hash = {}) ⇒ Identity

Create Identity from allowed hash values



8
9
10
11
12
13
14
# File 'lib/vsts/identity.rb', line 8

def initialize(identity_hash = {})
  identity_hash.select! { |k, _v| ["id", "displayName", "uniqueName", "url", "imageUrl"].include?(k) }
  identity_hash.each do |k, v|
    usk = underscore(k)
    public_send("#{usk}=", v)
  end
end

Instance Attribute Details

#display_nameObject

Returns the value of attribute display_name.



5
6
7
# File 'lib/vsts/identity.rb', line 5

def display_name
  @display_name
end

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/vsts/identity.rb', line 5

def id
  @id
end

#image_urlObject

Returns the value of attribute image_url.



5
6
7
# File 'lib/vsts/identity.rb', line 5

def image_url
  @image_url
end

#unique_nameObject

Returns the value of attribute unique_name.



5
6
7
# File 'lib/vsts/identity.rb', line 5

def unique_name
  @unique_name
end

#urlObject

Returns the value of attribute url.



5
6
7
# File 'lib/vsts/identity.rb', line 5

def url
  @url
end