debian-mirror-gitlab/lib/api/entities/personal_access_token.rb

14 lines
390 B
Ruby
Raw Normal View History

2020-03-13 15:44:24 +05:30
# frozen_string_literal: true
module API
module Entities
class PersonalAccessToken < Grape::Entity
2020-10-24 23:57:45 +05:30
expose :id, :name, :revoked, :created_at, :scopes, :user_id
2020-03-13 15:44:24 +05:30
expose :active?, as: :active
expose :expires_at do |personal_access_token|
personal_access_token.expires_at ? personal_access_token.expires_at.strftime("%Y-%m-%d") : nil
end
end
end
end