Class: HelpScout::User
- Inherits:
-
Object
- Object
- HelpScout::User
- Defined in:
- lib/helpscout/models.rb
Overview
User developer.helpscout.net/objects/user/
Name Type Example Notes
id Int 1234 Unique identifier
firstName String Jack
lastName String Sprout
email String [email protected]
role String owner Role of this user.
timezone String America/New_York
photoUrl String http://.../avatar.jpg The user's photo, if one
exists.
createdAt DateTime 2011-04-01T03:18:33Z UTC time when this user was
created.
modifiedAt DateTime 2012-07-24T20:18:33Z UTC time when this user was
modified.
Possible values for role include:
-
ROLE_OWNER
-
ROLE_ADMIN
-
ROLE_USER
Constant Summary collapse
- ROLE_OWNER =
"owner"
- ROLE_ADMIN =
"admin"
- ROLE_USER =
"user"
Instance Attribute Summary collapse
-
#createdAt ⇒ Object
readonly
Returns the value of attribute createdAt.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#firstName ⇒ Object
readonly
Returns the value of attribute firstName.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#lastName ⇒ Object
readonly
Returns the value of attribute lastName.
-
#modifiedAt ⇒ Object
readonly
Returns the value of attribute modifiedAt.
-
#photoUrl ⇒ Object
readonly
Returns the value of attribute photoUrl.
-
#role ⇒ Object
readonly
Returns the value of attribute role.
-
#timezone ⇒ Object
readonly
Returns the value of attribute timezone.
Instance Method Summary collapse
-
#initialize(object) ⇒ User
constructor
Creates a new User object from a Hash of attributes.
-
#to_s ⇒ Object
Returns a String suitable for display.
Constructor Details
#initialize(object) ⇒ User
Creates a new User object from a Hash of attributes
468 469 470 471 472 473 474 475 476 477 478 479 |
# File 'lib/helpscout/models.rb', line 468 def initialize(object) @createdAt = DateTime.iso8601(object["createdAt"]) if object["createdAt"] @modifiedAt = DateTime.iso8601(object["modifiedAt"]) if object["modifiedAt"] @id = object["id"] @firstName = object["firstName"] @lastName = object["lastName"] @email = object["email"] @role = object["role"] @timezone = object["timezone"] @photoUrl = object["photoUrl"] end |
Instance Attribute Details
#createdAt ⇒ Object (readonly)
Returns the value of attribute createdAt.
461 462 463 |
# File 'lib/helpscout/models.rb', line 461 def createdAt @createdAt end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
461 462 463 |
# File 'lib/helpscout/models.rb', line 461 def email @email end |
#firstName ⇒ Object (readonly)
Returns the value of attribute firstName.
461 462 463 |
# File 'lib/helpscout/models.rb', line 461 def firstName @firstName end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
461 462 463 |
# File 'lib/helpscout/models.rb', line 461 def id @id end |
#lastName ⇒ Object (readonly)
Returns the value of attribute lastName.
461 462 463 |
# File 'lib/helpscout/models.rb', line 461 def lastName @lastName end |
#modifiedAt ⇒ Object (readonly)
Returns the value of attribute modifiedAt.
461 462 463 |
# File 'lib/helpscout/models.rb', line 461 def modifiedAt @modifiedAt end |
#photoUrl ⇒ Object (readonly)
Returns the value of attribute photoUrl.
461 462 463 |
# File 'lib/helpscout/models.rb', line 461 def photoUrl @photoUrl end |
#role ⇒ Object (readonly)
Returns the value of attribute role.
461 462 463 |
# File 'lib/helpscout/models.rb', line 461 def role @role end |
#timezone ⇒ Object (readonly)
Returns the value of attribute timezone.
461 462 463 |
# File 'lib/helpscout/models.rb', line 461 def timezone @timezone end |
Instance Method Details
#to_s ⇒ Object
Returns a String suitable for display
482 483 484 |
# File 'lib/helpscout/models.rb', line 482 def to_s "#{@firstName} #{@lastName}" end |