Class: Gitlab::Git::WikiPage

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/git/wiki_page.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(gitaly_page, version) ⇒ WikiPage

This class abstracts away Gitlab::GitalyClient::WikiPage


9
10
11
12
13
14
15
16
17
18
19
# File 'lib/gitlab/git/wiki_page.rb', line 9

def initialize(gitaly_page, version)
  @url_path = gitaly_page.url_path
  @title = gitaly_page.title
  @format = gitaly_page.format
  @path = gitaly_page.path
  @raw_data = gitaly_page.raw_data
  @name = gitaly_page.name
  @historical = gitaly_page.historical?

  @version = version
end

Instance Attribute Details

#formatObject (readonly)

Returns the value of attribute format


6
7
8
# File 'lib/gitlab/git/wiki_page.rb', line 6

def format
  @format
end

#formatted_dataObject (readonly)

Returns the value of attribute formatted_data


6
7
8
# File 'lib/gitlab/git/wiki_page.rb', line 6

def formatted_data
  @formatted_data
end

#historicalObject (readonly)

Returns the value of attribute historical


6
7
8
# File 'lib/gitlab/git/wiki_page.rb', line 6

def historical
  @historical
end

#nameObject (readonly)

Returns the value of attribute name


6
7
8
# File 'lib/gitlab/git/wiki_page.rb', line 6

def name
  @name
end

#pathObject (readonly)

Returns the value of attribute path


6
7
8
# File 'lib/gitlab/git/wiki_page.rb', line 6

def path
  @path
end

#raw_dataObject (readonly)

Returns the value of attribute raw_data


6
7
8
# File 'lib/gitlab/git/wiki_page.rb', line 6

def raw_data
  @raw_data
end

#titleObject (readonly)

Returns the value of attribute title


6
7
8
# File 'lib/gitlab/git/wiki_page.rb', line 6

def title
  @title
end

#url_pathObject (readonly)

Returns the value of attribute url_path


6
7
8
# File 'lib/gitlab/git/wiki_page.rb', line 6

def url_path
  @url_path
end

#versionObject (readonly)

Returns the value of attribute version


6
7
8
# File 'lib/gitlab/git/wiki_page.rb', line 6

def version
  @version
end

Instance Method Details

#historical?Boolean

Returns:

  • (Boolean)

21
22
23
# File 'lib/gitlab/git/wiki_page.rb', line 21

def historical?
  @historical
end

#text_dataObject


25
26
27
28
29
# File 'lib/gitlab/git/wiki_page.rb', line 25

def text_data
  return @text_data if defined?(@text_data)

  @text_data = @raw_data && Gitlab::EncodingHelper.encode!(@raw_data.dup)
end