Class: SupportOps::GitLab::Markdown
- Defined in:
- lib/support_ops_gitlab/gitlab/markdown.rb
Overview
Defines the class Markdown within the module SupportOps::GitLab.
Instance Attribute Summary collapse
-
#allowed_email_domains_list ⇒ Array
Comma-separated list of email address domains to allow group access.
Class Method Summary collapse
-
.render(text, gfm = false, project = 'gitlab-org/gitlab') ⇒ Object
Renders text using Markdown.
Methods inherited from Base
#activate!, #approve!, attributes, #badges, #ban!, #block!, client, #client=, #commits, configure, #contributors, #create_support_pin!, #deactivate!, define_attributes, #delete!, #diffs, #disable_2fa!, #discussions, #emails, #encoded_path, #events, #find, #find!, #gpg_keys, #hard_delete!, #impersonations, #initialize, #issues, #jobs, #latest_pipeline, #members, #memberships, #merge_requests, #move!, #notes, #paid?, #pats, #pipeline_variables, #pipelines, #preferences, #projects, readonly_attributes, #reject!, #revoke!, #rotate!, #save!, #ssh_keys, #status, #store_original_attributes, #subscribe!, #support_pin, to_hash, #tokens, #unban!, #unblock!, #unsubscribe!, #webhooks
Constructor Details
This class inherits a constructor from SupportOps::GitLab::Base
Instance Attribute Details
#allowed_email_domains_list ⇒ Array
Comma-separated list of email address domains to allow group access
13 14 15 |
# File 'lib/support_ops_gitlab/gitlab/markdown.rb', line 13 def allowed_email_domains_list @allowed_email_domains_list end |
Class Method Details
.render(text, gfm = false, project = 'gitlab-org/gitlab') ⇒ Object
Renders text using Markdown
39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/support_ops_gitlab/gitlab/markdown.rb', line 39 def self.render(text, gfm = false, project = 'gitlab-org/gitlab') data = { text: text, gfm: gfm, project: project }.to_json response = client.connection.post('markdown', data) body = Oj.load(response.body) raise "Unable to render markdown => #{body}" unless response.status == 201 Markdown.new(body) end |