Module: AWS::EC2::FilteredCollection
- Included in:
- Collection
- Defined in:
- lib/aws/ec2/filtered_collection.rb
Instance Method Summary collapse
-
#filter(filter_name, *values) ⇒ Object
Specify one or more criteria to filter elastic IP addresses by.
- #filtered_request(client_method, options = {}, &block) ⇒ Object
- #initialize(options = {}) ⇒ Object
Instance Method Details
#filter(filter_name, *values) ⇒ Object
Specify one or more criteria to filter elastic IP addresses by. A subsequent call to #each will limit the results returned by provided filters.
-
Chain multiple calls of #filter together to AND multiple conditions together.
-
Supply multiple values to a singler #filter call to OR those value conditions together.
-
‘*’ matches one or more characters and ‘?’ matches any one character.
38 39 40 41 42 |
# File 'lib/aws/ec2/filtered_collection.rb', line 38 def filter filter_name, *values filters = @filters.dup filters << { :name => filter_name, :values => values.flatten } collection_with(:filters => filters) end |
#filtered_request(client_method, options = {}, &block) ⇒ Object
45 46 47 48 |
# File 'lib/aws/ec2/filtered_collection.rb', line 45 def filtered_request client_method, = {}, &block [:filters] = @filters unless @filters.empty? client.send(client_method, ) end |
#initialize(options = {}) ⇒ Object
20 21 22 23 |
# File 'lib/aws/ec2/filtered_collection.rb', line 20 def initialize = {} @filters = [:filters] || [] super end |