Class: UserInfoSerializer

Inherits:
ActiveModel::Serializer
  • Object
show all
Defined in:
app/serializers/user_info_serializer.rb

Instance Method Summary collapse

Instance Method Details

#nameObject


11
12
13
# File 'app/serializers/user_info_serializer.rb', line 11

def name
  (object.first_name || "") + (object.last_name || "")
end

#nicknameObject


15
16
17
# File 'app/serializers/user_info_serializer.rb', line 15

def nickname
  object.name
end

#pictureObject


23
24
25
# File 'app/serializers/user_info_serializer.rb', line 23

def picture
  object.image_url(fallback_to_default: false)
end

#profileObject


19
20
21
# File 'app/serializers/user_info_serializer.rb', line 19

def profile
  api_v1_user_url
end

#subObject


6
7
8
9
# File 'app/serializers/user_info_serializer.rb', line 6

def sub
  auth = serialization_options[:authorization]
  Api::OpenidConnect::SubjectIdentifierCreator.create(auth)
end