Class: UserProfileAttributeService

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

Instance Method Summary collapse

Constructor Details

#initialize(user) ⇒ UserProfileAttributeService

Returns a new instance of UserProfileAttributeService.



4
5
6
# File 'lib/user_profile_attribute_service.rb', line 4

def initialize(user)
  @user = user
end

Instance Method Details

#attribute_serialObject (private)



15
16
17
18
19
20
21
22
23
24
25
# File 'lib/user_profile_attribute_service.rb', line 15

def attribute_serial
  {
    uuid: SecureRandom.uuid,
    icn: @user.icn,
    first_name: @user.first_name,
    last_name: @user.last_name,
    email: @user.email,
    ssn: @user.ssn,
    flipper_id: @user.flipper_id
  }
end

#cache_profile_attributesObject



8
9
10
11
# File 'lib/user_profile_attribute_service.rb', line 8

def cache_profile_attributes
  cache = UserProfileAttributes.create(attribute_serial)
  cache.uuid
end