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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 686e17a72e2d629c3e22dddfaff2c45c9200736b
4
- data.tar.gz: e881f7acd76ef367cf50dea0d388d5ac2aa1fdfd
3
+ metadata.gz: d46de5c7d6317b5fd48fd9e83b73032fe068a869
4
+ data.tar.gz: b4ab6d12b99852e7019bae4b88c97f3eece513bf
5
5
  SHA512:
6
- metadata.gz: cb44b714880c517a51532d786c072edf28c45d92f59c45f2ec032fa5d3fb065e0e892a2e60180cd7cc741ec5f4690e0bf941a97d4291fa7ee24f6a5df0a309bc
7
- data.tar.gz: 3484937c5cbd17af4d44cce013e1be107e4db07c0dc48dd1d964048755ddd3ea9cfc2de88cc4b37063791f3dcc3a36e5332391e365b6dfbcc6109c8cb0ff178c
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
- def response
54
- @options[:response]
55
- end
59
+ attr_reader :response
56
60
 
57
61
  # @return [Integer]
58
- def size
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 !empty? && batch_method?(method_name)
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
 
@@ -56,7 +56,7 @@ module Aws
56
56
  yield(resource) if block_given?
57
57
  resource
58
58
  end
59
- Batch.new(resources, options)
59
+ Batch.new(resource_class, resources, options)
60
60
  end
61
61
 
62
62
  def build_one(identifiers, options)
@@ -78,7 +78,7 @@ module Aws
78
78
  if count == 1
79
79
  limit(1).to_a.first
80
80
  else
81
- Batch.new(limit(count).to_a)
81
+ Batch.new(resource_class, limit(count).to_a)
82
82
  end
83
83
  end
84
84
 
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.9.pre
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-13 00:00:00.000000000 Z
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.9
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.9
26
+ version: 2.0.10
27
27
  description: Provides resource-oriented abstractions for AWS.
28
28
  email:
29
29
  executables: []