Class: Gitlab::HookData::WikiPageBuilder

Inherits:
BaseBuilder show all
Defined in:
lib/gitlab/hook_data/wiki_page_builder.rb

Constant Summary

Constants inherited from BaseBuilder

BaseBuilder::MARKDOWN_SIMPLE_IMAGE

Instance Attribute Summary

Attributes inherited from BaseBuilder

#object

Instance Method Summary collapse

Methods inherited from BaseBuilder

#initialize

Constructor Details

This class inherits a constructor from Gitlab::HookData::BaseBuilder

Instance Method Details

#buildObject



8
9
10
11
12
13
14
15
# File 'lib/gitlab/hook_data/wiki_page_builder.rb', line 8

def build
  wiki_page
    .attributes
    .except(:content)
    .merge(
      version_id: wiki_page.version&.id
    )
end

#page_contentObject



17
18
19
# File 'lib/gitlab/hook_data/wiki_page_builder.rb', line 17

def page_content
  absolute_image_urls(wiki_page.content)
end

#uploads_prefixObject



21
22
23
# File 'lib/gitlab/hook_data/wiki_page_builder.rb', line 21

def uploads_prefix
  wiki_page.wiki.wiki_base_path
end