class Aws::Resources::Documenter

Public Class Methods

apply_customizations() click to toggle source
# File lib/aws-sdk-resources/documenter.rb, line 18
def apply_customizations
  document_s3_object_upload_file_additional_options
  document_s3_object_copy_from_options
end

Private Class Methods

document_s3_object_copy_from_options() click to toggle source
# File lib/aws-sdk-resources/documenter.rb, line 51
def document_s3_object_copy_from_options
  copy_from = YARD::Registry['Aws::S3::Object#copy_from']
  copy_to = YARD::Registry['Aws::S3::Object#copy_to']
  existing_tags = copy_from.tags
  existing_tags.each do |tag|
    if tag.tag_name == 'option' && tag.pair.name != ":copy_source"
      copy_from.add_tag(tag)
      copy_to.add_tag(tag)
    end
  end
end
document_s3_object_upload_file_additional_options() click to toggle source
# File lib/aws-sdk-resources/documenter.rb, line 25
def document_s3_object_upload_file_additional_options
  input = Aws::S3::Client.api.operation(:create_multipart_upload).input
  opts = input.shape.member_names - [:bucket, :key]
  tags = opts.map do |opt|
    ref = input.shape.member(opt)
    type = case ref.shape
    when StructureShape then 'Structure'
    when ListShape then 'Array'
    when MapShape then 'Hash'
    when StringShape then 'String'
    when IntegerShape then 'Integer'
    when FloatShape then 'Float'
    when BooleanShape then 'Boolean'
    when TimestampShape then 'Time'
    when BlobShape then 'IO'
    else
      raise "unhandled shape class `#{ref.shape.class.name}'"
    end
    docs = ref.documentation || ref.shape.documentation
    "@option options [#{type}] :#{opt} #{docs}"
  end
  tags = YARD::DocstringParser.new.parse(tags).to_docstring.tags
  m = YARD::Registry['Aws::S3::Object#upload_file']
  tags.each { |tag| m.add_tag(tag) }
end
tag(string) click to toggle source
# File lib/aws-sdk-resources/documenter.rb, line 63
def tag(string)
  YARD::DocstringParser.new.parse(string).to_docstring.tags.first
end