Class: RspecApiDocumentation::Views::MarkdownExample

Inherits:
MarkupExample
  • Object
show all
Defined in:
lib/rspec_api_documentation/views/markdown_example.rb

Direct Known Subclasses

SlateExample

Constant Summary collapse

EXTENSION =
'md'

Constants inherited from MarkupExample

RspecApiDocumentation::Views::MarkupExample::SPECIAL_CHARS

Instance Method Summary collapse

Methods inherited from MarkupExample

#dirname, #filename, #method_missing, #requests, #respond_to?, #response_fields

Constructor Details

#initialize(example, configuration) ⇒ MarkdownExample

Returns a new instance of MarkdownExample.



6
7
8
9
# File 'lib/rspec_api_documentation/views/markdown_example.rb', line 6

def initialize(example, configuration)
  super
  self.template_name = "rspec_api_documentation/markdown_example"
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RspecApiDocumentation::Views::MarkupExample

Instance Method Details

#extensionObject



19
20
21
# File 'lib/rspec_api_documentation/views/markdown_example.rb', line 19

def extension
  EXTENSION
end

#parametersObject



11
12
13
14
15
16
17
# File 'lib/rspec_api_documentation/views/markdown_example.rb', line 11

def parameters
  super.map do |parameter|
    parameter.merge({
      :required => parameter[:required] ? 'true' : 'false',
    })
  end
end