Class: Spark::Person
Instance Attribute Summary collapse
-
#avatar ⇒ Object
Returns the value of attribute avatar.
-
#created ⇒ Object
Returns the value of attribute created.
-
#displayName ⇒ Object
Returns the value of attribute displayName.
-
#emails ⇒ Object
Returns the value of attribute emails.
-
#firstName ⇒ Object
Returns the value of attribute firstName.
-
#id ⇒ Object
Returns the value of attribute id.
-
#lastActivity ⇒ Object
Returns the value of attribute lastActivity.
-
#lastName ⇒ Object
Returns the value of attribute lastName.
-
#nickName ⇒ Object
Returns the value of attribute nickName.
-
#orgId ⇒ Object
Returns the value of attribute orgId.
-
#status ⇒ Object
Returns the value of attribute status.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data) ⇒ Person
constructor
A new instance of Person.
Methods inherited from Base
#[], #delete, #refresh, #update
Constructor Details
#initialize(data) ⇒ Person
Returns a new instance of Person.
4 5 6 7 8 |
# File 'lib/person.rb', line 4 def initialize(data) @api_endpoint = 'people' @update_fields = [:emails, :displayName, :firstName, :lastName, :avatar, :orgId, :roles, :licenses] super end |
Instance Attribute Details
#avatar ⇒ Object
Returns the value of attribute avatar.
3 4 5 |
# File 'lib/person.rb', line 3 def avatar @avatar end |
#created ⇒ Object
Returns the value of attribute created.
3 4 5 |
# File 'lib/person.rb', line 3 def created @created end |
#displayName ⇒ Object
Returns the value of attribute displayName.
3 4 5 |
# File 'lib/person.rb', line 3 def displayName @displayName end |
#emails ⇒ Object
Returns the value of attribute emails.
3 4 5 |
# File 'lib/person.rb', line 3 def emails @emails end |
#firstName ⇒ Object
Returns the value of attribute firstName.
3 4 5 |
# File 'lib/person.rb', line 3 def firstName @firstName end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/person.rb', line 3 def id @id end |
#lastActivity ⇒ Object
Returns the value of attribute lastActivity.
3 4 5 |
# File 'lib/person.rb', line 3 def lastActivity @lastActivity end |
#lastName ⇒ Object
Returns the value of attribute lastName.
3 4 5 |
# File 'lib/person.rb', line 3 def lastName @lastName end |
#nickName ⇒ Object
Returns the value of attribute nickName.
3 4 5 |
# File 'lib/person.rb', line 3 def nickName @nickName end |
#orgId ⇒ Object
Returns the value of attribute orgId.
3 4 5 |
# File 'lib/person.rb', line 3 def orgId @orgId end |
#status ⇒ Object
Returns the value of attribute status.
3 4 5 |
# File 'lib/person.rb', line 3 def status @status end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/person.rb', line 3 def type @type end |
Class Method Details
.Create(email, payload = {}) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/person.rb', line 18 def Create(email, payload={}) payload[:email] = email res = Spark::rest('POST',"/people", {:payload => payload}) if res.ok person = Spark::Person.new(JSON.parse(res.body)) return person end return nil end |