aws-sdk-resources 2.0.9.pre → 2.0.10.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/aws-sdk-resources/batch.rb +13 -20
- data/lib/aws-sdk-resources/builder.rb +1 -1
- data/lib/aws-sdk-resources/collection.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d46de5c7d6317b5fd48fd9e83b73032fe068a869
|
4
|
+
data.tar.gz: b4ab6d12b99852e7019bae4b88c97f3eece513bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6be0b745b9c9d6a4ec4f25a93fa2b9272692d28da54cd834bf355e4056f5b6e8371f578eaae9d991ec6ec67582b4cc02d5ca3e779403050b7d78bb03b141901d
|
7
|
+
data.tar.gz: 073755fa59df54d46d2260ec9e7161930f93e7c06e95241880d7af448cb494214e04f32351adb31fc2e7439a1d424c17efb0345c8ebb9ea0d9f35a99bf62b444
|
@@ -44,20 +44,22 @@ module Aws
|
|
44
44
|
|
45
45
|
# @param [Array<Resource>] resources
|
46
46
|
# @option options [Seahorse::Client::Response] :response
|
47
|
-
def initialize(resources, options = {})
|
47
|
+
def initialize(resource_class, resources, options = {})
|
48
|
+
@resource_class = resource_class
|
48
49
|
@resources = resources
|
50
|
+
@response = options[:response]
|
51
|
+
@size = resources.size
|
49
52
|
@options = options
|
50
53
|
end
|
51
54
|
|
55
|
+
# @return [Class<Resource>]
|
56
|
+
attr_reader :resource_class
|
57
|
+
|
52
58
|
# @return [Seahorse::Client::Response, nil]
|
53
|
-
|
54
|
-
@options[:response]
|
55
|
-
end
|
59
|
+
attr_reader :response
|
56
60
|
|
57
61
|
# @return [Integer]
|
58
|
-
|
59
|
-
@resources.size
|
60
|
-
end
|
62
|
+
attr_reader :size
|
61
63
|
|
62
64
|
alias count size
|
63
65
|
|
@@ -78,7 +80,7 @@ module Aws
|
|
78
80
|
# @return [Resource, Batch]
|
79
81
|
def first(count = nil)
|
80
82
|
if count
|
81
|
-
self.class.new(@resources.first(count), @options)
|
83
|
+
self.class.new(@resource_class, @resources.first(count), @options)
|
82
84
|
else
|
83
85
|
@resources.first
|
84
86
|
end
|
@@ -91,19 +93,18 @@ module Aws
|
|
91
93
|
|
92
94
|
# @api private
|
93
95
|
def inspect
|
94
|
-
"#<#{self.class.name} resources=#{@resources}>"
|
96
|
+
"#<#{self.class.name} resources=#{@resources.inspect}>"
|
95
97
|
end
|
96
98
|
|
97
99
|
# @api private
|
98
100
|
def respond_to?(method_name, *args)
|
99
|
-
if
|
101
|
+
if @resource_class.batch_operation_names.include?(method_name.to_sym)
|
100
102
|
true
|
101
103
|
else
|
102
104
|
super
|
103
105
|
end
|
104
106
|
end
|
105
107
|
|
106
|
-
|
107
108
|
# @api private
|
108
109
|
def method_missing(method_name, *args, &block)
|
109
110
|
if respond_to?(method_name)
|
@@ -115,16 +116,8 @@ module Aws
|
|
115
116
|
|
116
117
|
private
|
117
118
|
|
118
|
-
def batch_method?(method_name)
|
119
|
-
resource_class.batch_operation_names.include?(method_name.to_sym)
|
120
|
-
end
|
121
|
-
|
122
|
-
def resource_class
|
123
|
-
@resources.first.class
|
124
|
-
end
|
125
|
-
|
126
119
|
def invoke_batch_operation(method_name, args, block)
|
127
|
-
operation = resource_class.batch_operation(method_name)
|
120
|
+
operation = @resource_class.batch_operation(method_name)
|
128
121
|
operation.call(resource:self, args:args, block:block)
|
129
122
|
end
|
130
123
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-sdk-resources
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.10.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Amazon Web Services
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.0.
|
19
|
+
version: 2.0.10
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.0.
|
26
|
+
version: 2.0.10
|
27
27
|
description: Provides resource-oriented abstractions for AWS.
|
28
28
|
email:
|
29
29
|
executables: []
|