Module: AWS::ELB::FilteredCollection

Defined in:
lib/aws/elb/filtered_collection.rb

Instance Method Summary collapse

Instance Method Details

#each(&block) ⇒ Object



28
29
30
31
32
# File 'lib/aws/elb/filtered_collection.rb', line 28

def each(&block)
  super do |lb|
    yield(lb) if matches_filters?(lb)
  end
end

#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.


22
23
24
25
26
# File 'lib/aws/elb/filtered_collection.rb', line 22

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

#initialize(options = {}) ⇒ Object



6
7
8
9
# File 'lib/aws/elb/filtered_collection.rb', line 6

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