Class: Gitlab::GitalyClient::WikiPage

Inherits:
Object
  • Object
show all
Includes:
EncodingHelper, AttributesBag
Defined in:
lib/gitlab/gitaly_client/wiki_page.rb

Constant Summary collapse

ATTRS =
%i(title format url_path path name historical raw_data).freeze

Constants included from EncodingHelper

EncodingHelper::ENCODING_CONFIDENCE_THRESHOLD

Instance Method Summary collapse

Methods included from EncodingHelper

#binary_io, #detect_binary?, #detect_libgit2_binary?, #encode!, #encode_binary, #encode_utf8

Methods included from AttributesBag

#==, #attributes

Constructor Details

#initialize(params) ⇒ WikiPage

Returns a new instance of WikiPage.


11
12
13
14
15
16
17
18
19
20
21
# File 'lib/gitlab/gitaly_client/wiki_page.rb', line 11

def initialize(params)
  super

  # 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

  @title = encode_utf8(@title)
  @path = encode_utf8(@path)
  @name = encode_utf8(@name)
end

Instance Method Details

#formatObject


27
28
29
# File 'lib/gitlab/gitaly_client/wiki_page.rb', line 27

def format
  @format.to_sym
end

#historical?Boolean

Returns:

  • (Boolean)

23
24
25
# File 'lib/gitlab/gitaly_client/wiki_page.rb', line 23

def historical?
  @historical
end