debian-mirror-gitlab/lib/gitlab/git/wiki_page.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
864 B
Ruby
Raw Permalink Normal View History

2019-02-15 15:39:39 +05:30
# frozen_string_literal: true
2018-03-17 18:26:18 +05:30
module Gitlab
module Git
class WikiPage
2020-10-24 23:57:45 +05:30
attr_reader :url_path, :title, :format, :path, :version, :raw_data, :name, :historical, :formatted_data
2018-03-17 18:26:18 +05:30
2022-10-11 01:57:18 +05:30
def initialize(hash)
@url_path = hash[:url_path]
@title = hash[:title]
@format = hash[:format]
@path = hash[:path]
@raw_data = hash[:raw_data]
@name = hash[:name]
@historical = hash[:historical]
@version = hash[:version]
2018-03-17 18:26:18 +05:30
end
def historical?
@historical
end
def text_data
return @text_data if defined?(@text_data)
@text_data = @raw_data && Gitlab::EncodingHelper.encode!(@raw_data.dup)
end
2022-11-25 23:54:43 +05:30
def raw_data=(data)
@raw_data = data
@text_data = @raw_data && Gitlab::EncodingHelper.encode!(@raw_data.dup)
end
2018-03-17 18:26:18 +05:30
end
end
end