Class: Brainstem::ApiDocs::Formatters::Markdown::PresenterFormatter

Inherits:
AbstractFormatter
  • Object
show all
Includes:
Helper
Defined in:
lib/brainstem/api_docs/formatters/markdown/presenter_formatter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helper

#md_a, #md_code, #md_h1, #md_h2, #md_h3, #md_h4, #md_h5, #md_hr, #md_inline_code, #md_inline_type, #md_li, #md_p, #md_strong, #md_ul

Methods inherited from AbstractFormatter

call

Methods included from Concerns::Optional

#valid_options

Constructor Details

#initialize(presenter, options = {}) ⇒ PresenterFormatter

Returns a new instance of PresenterFormatter.



12
13
14
15
16
# File 'lib/brainstem/api_docs/formatters/markdown/presenter_formatter.rb', line 12

def initialize(presenter, options = {})
  self.presenter = presenter
  self.output    = ""
  super options
end

Instance Attribute Details

#outputObject

Returns the value of attribute output.



18
19
20
# File 'lib/brainstem/api_docs/formatters/markdown/presenter_formatter.rb', line 18

def output
  @output
end

#presenterObject

Returns the value of attribute presenter.



18
19
20
# File 'lib/brainstem/api_docs/formatters/markdown/presenter_formatter.rb', line 18

def presenter
  @presenter
end

Instance Method Details

#callObject



21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/brainstem/api_docs/formatters/markdown/presenter_formatter.rb', line 21

def call
  return output if presenter.nodoc?

  format_title!
  format_brainstem_keys!
  format_description!
  format_fields!
  format_filters!
  format_sort_orders!
  format_associations!

  output
end