1# frozen_string_literal: true
2
3module API
4  module Entities
5    class WikiAttachment < Grape::Entity
6      include Gitlab::FileMarkdownLinkBuilder
7
8      expose :file_name
9      expose :file_path
10      expose :branch
11      expose :link do
12        expose :file_path, as: :url
13        expose :markdown do |_entity|
14          self.markdown_link
15        end
16      end
17
18      def filename
19        object.file_name
20      end
21
22      def secure_url
23        object.file_path
24      end
25    end
26  end
27end
28