Class: Brainstem::ApiDocs::Formatters::Markdown::EndpointFormatter

Inherits:
AbstractFormatter
  • Object
show all
Extended by:
Forwardable
Includes:
Helper
Defined in:
lib/brainstem/api_docs/formatters/markdown/endpoint_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(endpoint, options = {}) ⇒ EndpointFormatter

Returns a new instance of EndpointFormatter.



23
24
25
26
27
28
# File 'lib/brainstem/api_docs/formatters/markdown/endpoint_formatter.rb', line 23

def initialize(endpoint, options = {})
  self.endpoint = endpoint
  self.output   = ""

  super options
end

Instance Attribute Details

#endpointObject

Returns the value of attribute endpoint.



31
32
33
# File 'lib/brainstem/api_docs/formatters/markdown/endpoint_formatter.rb', line 31

def endpoint
  @endpoint
end

#outputObject

Returns the value of attribute output.



31
32
33
# File 'lib/brainstem/api_docs/formatters/markdown/endpoint_formatter.rb', line 31

def output
  @output
end

Instance Method Details

#callObject



35
36
37
38
39
40
41
42
43
44
45
# File 'lib/brainstem/api_docs/formatters/markdown/endpoint_formatter.rb', line 35

def call
  return output if endpoint.nodoc?

  format_title!
  format_description!
  format_endpoint!
  format_params!
  format_presents!

  output
end