You are viewing documentation for version 1 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Module: AWS::EC2::FilteredCollection

Included in:
Collection
Defined in:
lib/aws/ec2/filtered_collection.rb

Instance Method Summary collapse

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.


35
36
37
38
39
# File 'lib/aws/ec2/filtered_collection.rb', line 35

def filter filter_name, *values
  filters = @filters.dup
  filters << { :name => filter_name, :values => values.flatten }
  collection_with(:filters => filters)
end

#initialize(options = {}) ⇒ Object



19
20
21
22
# File 'lib/aws/ec2/filtered_collection.rb', line 19

def initialize options = {}
  @filters = options[:filters] || []
  super
end