Class: HelpScout::Person
- Inherits:
-
Object
- Object
- HelpScout::Person
- Defined in:
- lib/helpscout/models.rb
Overview
Person developer.helpscout.net/objects/person/
The person object is a subset of the data representing a Customer or User. The ‘type’ property will specify if this person is represented by a ‘user’ or a ‘customer’.
Name Type Example Notes
id Int 1234 Unique identifier
firstName String Jack
lastName String Sprout
email String [email protected]
phone String 800-555-1212
type String user
Possible values for type include:
-
TYPE_USER
-
TYPE_CUSTOMER
Constant Summary collapse
- TYPE_USER =
"user"
- TYPE_CUSTOMER =
"customer"
Instance Attribute Summary collapse
-
#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.
-
#phone ⇒ Object
readonly
Returns the value of attribute phone.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(object) ⇒ Person
constructor
Creates a new Person object from a Hash of attributes.
-
#to_s ⇒ Object
Returns a String suitable for display.
Constructor Details
#initialize(object) ⇒ Person
Creates a new Person object from a Hash of attributes
422 423 424 425 426 427 428 429 |
# File 'lib/helpscout/models.rb', line 422 def initialize(object) @id = object["id"] @firstName = object["firstName"] @lastName = object["lastName"] @email = object["email"] @phone = object["phone"] @type = object["type"] end |
Instance Attribute Details
#email ⇒ Object (readonly)
Returns the value of attribute email.
416 417 418 |
# File 'lib/helpscout/models.rb', line 416 def email @email end |
#firstName ⇒ Object (readonly)
Returns the value of attribute firstName.
416 417 418 |
# File 'lib/helpscout/models.rb', line 416 def firstName @firstName end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
416 417 418 |
# File 'lib/helpscout/models.rb', line 416 def id @id end |
#lastName ⇒ Object (readonly)
Returns the value of attribute lastName.
416 417 418 |
# File 'lib/helpscout/models.rb', line 416 def lastName @lastName end |
#phone ⇒ Object (readonly)
Returns the value of attribute phone.
416 417 418 |
# File 'lib/helpscout/models.rb', line 416 def phone @phone end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
416 417 418 |
# File 'lib/helpscout/models.rb', line 416 def type @type end |
Instance Method Details
#to_s ⇒ Object
Returns a String suitable for display
432 433 434 |
# File 'lib/helpscout/models.rb', line 432 def to_s "#{@firstName} #{@lastName}" end |