Class: Aws::Resources::Documenter::DataOperationDocumenter

Inherits:
BaseOperationDocumenter show all
Defined in:
aws-sdk-resources/lib/aws-sdk-resources/documenter/data_operation_documenter.rb

Instance Attribute Summary

Attributes inherited from BaseOperationDocumenter

#api_request, #api_request_name, #api_request_params, #builder, #called_operation, #operation_name, #resource_class, #resource_class_name, #source, #target_resource_class, #target_resource_class_name, #yard_class

Instance Method Summary collapse

Methods inherited from BaseOperationDocumenter

#initialize, #method_object

Constructor Details

This class inherits a constructor from Aws::Resources::Documenter::BaseOperationDocumenter

Instance Method Details

#data_membersObject


24
25
26
# File 'aws-sdk-resources/lib/aws-sdk-resources/documenter/data_operation_documenter.rb', line 24

def data_members
  "\n" + path_shape.member_names.map{ |n| "\n* `#{n}`" }.join("\n")
end

#docstringObject


6
7
8
9
10
11
12
# File 'aws-sdk-resources/lib/aws-sdk-resources/documenter/data_operation_documenter.rb', line 6

def docstring
  if plural?
    super + " Calls {#{called_operation}}, returning an array of {#{path_type}} objects."
  else
    super + " Calls {#{called_operation}}, returning a #{return_type.first}."
  end
end

#plural?Boolean

Returns:

  • (Boolean)

36
37
38
# File 'aws-sdk-resources/lib/aws-sdk-resources/documenter/data_operation_documenter.rb', line 36

def plural?
  !!@operation.path.match(/\[/)
end

#return_messageObject


14
15
16
17
18
19
20
21
22
# File 'aws-sdk-resources/lib/aws-sdk-resources/documenter/data_operation_documenter.rb', line 14

def return_message
  if plural? && structure?
    "an array of {Structure structures} with the following memers:\n" + data_members
  elsif structure?
    "a {Structure} with the following members:\n" + data_members
  else
    ''
  end
end

#return_typeObject


28
29
30
31
32
33
34
# File 'aws-sdk-resources/lib/aws-sdk-resources/documenter/data_operation_documenter.rb', line 28

def return_type
  if plural?
    ["Array<#{path_type}>"]
  else
    [path_type]
  end
end

#structure?Boolean

Returns:

  • (Boolean)

40
41
42
# File 'aws-sdk-resources/lib/aws-sdk-resources/documenter/data_operation_documenter.rb', line 40

def structure?
  Seahorse::Model::Shapes::Structure === path_shape
end