summaryrefslogtreecommitdiff
path: root/lib/gitlab/git/wiki_file.rb
blob: 84335aca4bc8f8984fb982d3d254549f625eee30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
module Gitlab
  module Git
    class WikiFile
      attr_reader :mime_type, :raw_data, :name, :path

      # This class is meant to be serializable so that it can be constructed
      # by Gitaly and sent over the network to GitLab.
      #
      # Because Gollum::File is not serializable we must get all the data from
      # 'gollum_file' during initialization, and NOT store it in an instance
      # variable.
      def initialize(gollum_file)
        @mime_type = gollum_file.mime_type
        @raw_data = gollum_file.raw_data
        @name = gollum_file.name
        @path = gollum_file.path
      end
    end
  end
end