Class: Aws::Api::OperationDocumenter Private

Inherits:
Object
  • Object
show all
Defined in:
lib/aws-sdk-core/api/operation_documenter.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ OperationDocumenter

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of OperationDocumenter.



5
6
7
8
# File 'lib/aws-sdk-core/api/operation_documenter.rb', line 5

def initialize(options)
  @operation = options[:operation]
  @example = OperationExample.new(options)
end

Instance Method Details

#api_ref(shape) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



47
48
49
50
51
52
# File 'lib/aws-sdk-core/api/operation_documenter.rb', line 47

def api_ref(shape)
  docs = shape.nil? ? '' : shape.documentation
  if docs && !docs.empty?
    "<div class=\"api-ref\">#{clean(docs)}</div>"
  end
end

#clean(docs) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



38
39
40
41
42
43
44
45
# File 'lib/aws-sdk-core/api/operation_documenter.rb', line 38

def clean(docs)
  docs = docs.gsub(/<!--.*?-->/m, '')
  docs = docs.gsub(/<examples?>.+?<\/examples?>/m, '')
  docs = docs.gsub(/<\/?note>/m, '')
  docs = docs.gsub(/\{(\S+)\}/, '`{\1}`')
  docs = docs.gsub(/\s+/, ' ').strip
  docs
end

#exampleObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



34
35
36
# File 'lib/aws-sdk-core/api/operation_documenter.rb', line 34

def example
  @example
end

#inputObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/aws-sdk-core/api/operation_documenter.rb', line 10

def input
  params(nil) do
    if @operation.input
      lines = []
      if @operation.output
        lines << '<div class="param"><div class="entry"><span class="key">:response_target</span> => String, Pathname, File</div>Optional path to a file or file object where the HTTP response body should be written.</div>'
      end
      lines + structure(@operation.input, [])
    else
      []
    end
  end.join
end

#outputObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



24
25
26
27
28
29
30
31
32
# File 'lib/aws-sdk-core/api/operation_documenter.rb', line 24

def output
  params(nil) do
    if @operation.output
      structure(@operation.output, [])
    else
      []
    end
  end.join
end