debian-mirror-gitlab/lib/atlassian/jira_connect/serializers/author_entity.rb
2020-11-24 15:15:51 +05:30

24 lines
531 B
Ruby

# frozen_string_literal: true
module Atlassian
module JiraConnect
module Serializers
class AuthorEntity < Grape::Entity
include Gitlab::Routing
expose :name
expose :email
with_options(unless: -> (user) { user.is_a?(CommitEntity::CommitAuthor) }) do
expose :username
expose :url do |user|
user_url(user)
end
expose :avatar do |user|
user.avatar_url(only_path: false)
end
end
end
end
end
end