Class: Aws::Resources::Documenter::HasOperationDocumenter

Inherits:
BaseOperationDocumenter show all
Defined in:
lib/aws-sdk-resources/documenter/has_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

#argument?Boolean

Returns:

  • (Boolean)


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

def argument?
  @operation.arity > 0
end

#argument_name(argument) ⇒ Object



59
60
61
# File 'lib/aws-sdk-resources/documenter/has_operation_documenter.rb', line 59

def argument_name(argument)
  argument.target.to_s
end

#argumentsObject



53
54
55
56
57
# File 'lib/aws-sdk-resources/documenter/has_operation_documenter.rb', line 53

def arguments
  builder.sources.select do |source|
    BuilderSources::Argument === source
  end
end

#can_return_nil?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/aws-sdk-resources/documenter/has_operation_documenter.rb', line 45

def can_return_nil?
  data_member
end

#data_memberObject



49
50
51
# File 'lib/aws-sdk-resources/documenter/has_operation_documenter.rb', line 49

def data_member
  builder.sources.find { |s| BuilderSources::DataMember === s }
end

#parametersObject



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

def parameters
  if argument?
    arguments.map { |arg| [argument_name(arg), nil] }
  else
    []
  end
end

#plural?Boolean

Returns:

  • (Boolean)


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

def plural?
  @operation.builder.plural?
end

#return_tagObject



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

def return_tag
  if plural?
    type = "Array<#{target_resource_class_name}>"
  else
    type = target_resource_class_name
  end
  type += ',nil' if can_return_nil?
  tag("@return [#{type}]")
end

#tagsObject



24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/aws-sdk-resources/documenter/has_operation_documenter.rb', line 24

def tags
  tags = super
  if argument?
    arguments.each do |arg|
      tag = "@param [String] #{argument_name(arg)} "
      tag << "The {#{target_resource_class_name}##{argument_name(arg)}} "
      tag << "identifier."
      tags += YARD::DocstringParser.new.parse(tag).to_docstring.tags
    end
  end
  tags
end