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.



43
44
45
46
47
48
# File 'lib/aws-sdk-core/api/operation_documenter.rb', line 43

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.



34
35
36
37
38
39
40
41
# File 'lib/aws-sdk-core/api/operation_documenter.rb', line 34

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.



30
31
32
# File 'lib/aws-sdk-core/api/operation_documenter.rb', line 30

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
# File 'lib/aws-sdk-core/api/operation_documenter.rb', line 10

def input
  params(nil) do
    if @operation.input
      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.



20
21
22
23
24
25
26
27
28
# File 'lib/aws-sdk-core/api/operation_documenter.rb', line 20

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