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.



37
38
39
40
41
# File 'lib/aws/ec2/filtered_collection.rb', line 37

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