Class: Marlens::JiraApi::AdfToMarkdown

Inherits:
Object
  • Object
show all
Defined in:
lib/marlens/jira_api/adf_to_markdown.rb

Constant Summary collapse

BLOCK_TYPES =
%w[doc paragraph heading blockquote orderedList bulletList listItem].freeze

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(document) ⇒ AdfToMarkdown

Returns a new instance of AdfToMarkdown.



12
13
14
# File 'lib/marlens/jira_api/adf_to_markdown.rb', line 12

def initialize(document)
  @document = document.is_a?(Hash) ? document : {}
end

Class Method Details

.call(document) ⇒ Object



8
9
10
# File 'lib/marlens/jira_api/adf_to_markdown.rb', line 8

def self.call(document)
  new(document).to_markdown
end

Instance Method Details

#to_markdownObject



16
17
18
# File 'lib/marlens/jira_api/adf_to_markdown.rb', line 16

def to_markdown
  render_block(@document).strip
end