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(hash) ⇒ WikiPage

Returns a new instance of WikiPage.



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

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]
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

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)


19
20
21
# File 'lib/gitlab/git/wiki_page.rb', line 19

def historical?
  @historical
end

#text_dataObject



23
24
25
26
27
# File 'lib/gitlab/git/wiki_page.rb', line 23

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

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