Class: Meibo::UserProfile

Inherits:
Object
  • Object
show all
Defined in:
lib/meibo/user_profile.rb

Direct Known Subclasses

EportalV3::UserProfile

Instance Method Summary collapse

Constructor Details

#initialize(sourced_id:, user_sourced_id:, profile_type:, vendor_id:, credential_type:, username:, status: nil, date_last_modified: nil, application_id: nil, description: nil, password: nil, **extension_fields) ⇒ UserProfile

Returns a new instance of UserProfile.



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/meibo/user_profile.rb', line 27

def initialize(sourced_id:, user_sourced_id:, profile_type:, vendor_id:, credential_type:, username:, status: nil, date_last_modified: nil,
               application_id: nil, description: nil, password: nil, **extension_fields)
  @sourced_id = sourced_id
  @status = status
  @date_last_modified = date_last_modified
  @user_sourced_id = user_sourced_id
  @profile_type = profile_type
  @vendor_id = vendor_id
  @application_id = application_id
  @description = description
  @credential_type = credential_type
  @username = username
  @password = password
  @extension_fields = extension_fields
end

Instance Method Details

#collectionObject



43
44
45
# File 'lib/meibo/user_profile.rb', line 43

def collection
  Meibo.current_roster.user_profiles
end

#roleObject



51
52
53
# File 'lib/meibo/user_profile.rb', line 51

def role
  Meibo.current_roster.roles.where(user_profile_sourced_id: sourced_id).first
end

#userObject



47
48
49
# File 'lib/meibo/user_profile.rb', line 47

def user
  Meibo.current_roster.users.find(user_sourced_id)
end