Class: MOCO::Profile

Inherits:
BaseEntity show all
Defined in:
lib/moco/entities/profile.rb

Overview

Represents the current API user’s profile Read-only singleton endpoint for the authenticated user

Read-only attributes:

id, firstname, lastname, email, unit (Hash),
created_at, updated_at

Usage:

profile = moco.profile.get
puts "Logged in as: #{profile.firstname} #{profile.lastname}"

Note:

This returns information about the user who owns the API key.
For other user information, use moco.users.

Instance Attribute Summary

Attributes inherited from BaseEntity

#attributes, #client

Instance Method Summary collapse

Methods inherited from BaseEntity

#==, #association, #destroy, #eql?, #has_many, #hash, #id, #initialize, #inspect, #reload, #save, #to_h, #to_json, #update

Constructor Details

This class inherits a constructor from MOCO::BaseEntity

Instance Method Details

#to_sObject



20
21
22
# File 'lib/moco/entities/profile.rb', line 20

def to_s
  "#{firstname} #{lastname}"
end