You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.
Class: Aws::Resources::BuilderA Builder construct resource objects. It extracts resource identifiers for the objects it builds from another resource object and/or an AWS response.
Instance Attribute Summary collapseA list of resource identifier sources.
Returns a resource object or an array of resource objects if #plural?.
A new instance of Builder.
Returns true
if this builder returns an array of resource objects from #build.
Returns a new instance of Builder.
13 14 15 16
# File 'aws-sdk-resources/lib/aws-sdk-resources/builder.rb', line 13 def initialize(options = {}) @resource_class = options[:resource_class] @sources = options[:sources] || [] endInstance Attribute Details #resource_class ⇒ Class<Resource>
19 20 21
# File 'aws-sdk-resources/lib/aws-sdk-resources/builder.rb', line 19 def resource_class @resource_class end#sources ⇒ Array<BuilderSources::Source>
Returns A list of resource identifier sources.
23 24 25
# File 'aws-sdk-resources/lib/aws-sdk-resources/builder.rb', line 23 def sources @sources endInstance Method Details #build(options = {}) ⇒ Resource+
Returns a resource object or an array of resource objects if #plural?.
35 36 37 38 39 40 41 42 43 44
# File 'aws-sdk-resources/lib/aws-sdk-resources/builder.rb', line 35 def build(options = {}) identifier_map = @sources.each.with_object({}) do |source, hash| hash[source.target] = source.(options) end if plural? build_batch(identifier_map, options) else build_one(identifier_map, options) end end#plural? ⇒ Boolean
Returns true
if this builder returns an array of resource objects from #build.
27 28 29
# File 'aws-sdk-resources/lib/aws-sdk-resources/builder.rb', line 27 def plural? @sources.any?(&:plural?) end
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4