Class: Gitlab::GitalyClient::WikiPage
- Inherits:
-
Object
- Object
- Gitlab::GitalyClient::WikiPage
- 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::BOM_UTF8, EncodingHelper::ENCODING_CONFIDENCE_THRESHOLD, EncodingHelper::ESCAPED_CHARS, EncodingHelper::UNICODE_REPLACEMENT_CHARACTER
Instance Method Summary collapse
- #format ⇒ Object
- #historical? ⇒ Boolean
-
#initialize(params) ⇒ WikiPage
constructor
A new instance of WikiPage.
Methods included from EncodingHelper
#binary_io, #detect_binary?, #detect_encoding, #detect_libgit2_binary?, #encode!, #encode_binary, #encode_utf8, #encode_utf8_no_detect, #encode_utf8_with_escaping!, #encode_utf8_with_replacement_character, #strip_bom, #unquote_path
Methods included from AttributesBag
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
#format ⇒ Object
27 28 29 |
# File 'lib/gitlab/gitaly_client/wiki_page.rb', line 27 def format @format.to_sym end |
#historical? ⇒ Boolean
23 24 25 |
# File 'lib/gitlab/gitaly_client/wiki_page.rb', line 23 def historical? @historical end |