2018-11-09 13:39:43 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-10-19 10:18:26 -04:00
|
|
|
module Gitlab
|
|
|
|
module GitalyClient
|
|
|
|
class WikiPage
|
2017-11-13 05:05:16 -05:00
|
|
|
ATTRS = %i(title format url_path path name historical raw_data).freeze
|
2017-10-19 10:18:26 -04:00
|
|
|
|
2017-11-13 05:05:16 -05:00
|
|
|
include AttributesBag
|
2018-02-05 06:26:25 -05:00
|
|
|
include Gitlab::EncodingHelper
|
2017-10-19 10:18:26 -04:00
|
|
|
|
|
|
|
def initialize(params)
|
2017-11-13 05:05:16 -05:00
|
|
|
super
|
2017-11-09 18:27:00 -05:00
|
|
|
|
|
|
|
# All gRPC strings in a response are frozen, so we get an unfrozen
|
|
|
|
# version here so appending to `raw_data` doesn't blow up.
|
|
|
|
@raw_data = @raw_data.dup
|
2018-02-05 06:26:25 -05:00
|
|
|
|
|
|
|
@title = encode_utf8(@title)
|
|
|
|
@path = encode_utf8(@path)
|
|
|
|
@name = encode_utf8(@name)
|
2017-10-19 10:18:26 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def historical?
|
|
|
|
@historical
|
|
|
|
end
|
|
|
|
|
|
|
|
def format
|
|
|
|
@format.to_sym
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|