Manual Reference Source Test
public class | source

Profile

Expression Extends:

class Profile extends aggregate(ProfileModel, Helper)

Helper class representing a user profile.

Static Member Summary

Static Public Members
public static get

Constructor Summary

Public Constructor
public

Constructor for helper class representing a Profile

Member Summary

Public Members
public

avatar: *

public get
public set
public get
public set
public get
public set
Private Members
private

Method Summary

Public Methods
public

Returns the full address of the user

public

Returns the full name of the user.

public

Updates the profile information for the current instance of profile.

public

toJSON(): *

Static Public Members

public static get type: String source

Public Constructors

public constructor(json: Object) source

Constructor for helper class representing a Profile

Params:

NameTypeAttributeDescription
json Object

json api response from server

Public Members

public avatar: * source

public get language: Language source

public set language: Language source

public get profileable: User source

public set profileable: User source

public get user: User source

public set user: User source

Private Members

private _relationships: {} source

Public Methods

public getFullAddress(): String source

Returns the full address of the user

Return:

String

The full address

Example:

client.getProfile().then(profile => {
  console.log('Full Address', profile.getFullAddress());
});

Test:

public getFullName(): String source

Returns the full name of the user.

Return:

String

The user's full name

Example:

client.getProfile().then(profile => {
  console.log('Full Name', profile.getFullName());
});

Test:

public save(): Promise source

Updates the profile information for the current instance of profile. This method should be called after making changes to the profile object. I.e. profile.age = 25 then call profile.save() to save this change.

Return:

Promise

Promise object that returns success or failure

Example:

client.getProfile().then(profile => {
  profile.zip_code = '12345';
  profile.save().then((response) => {
    console.log(response);
  });
});

Test:

public toJSON(): * source

Return:

*