class BurdenedAcrobat::LoadBalancers

Public Class Methods

new(**options) click to toggle source
# File lib/burdened-acrobat/load_balancers.rb, line 14
def initialize(**options)
  @options = options
  refresh!
  self
end

Public Instance Methods

all() click to toggle source
# File lib/burdened-acrobat/load_balancers.rb, line 33
def all
  @all ||= all!
end
named(names) click to toggle source
# File lib/burdened-acrobat/load_balancers.rb, line 83
def named(names)
  Set.new names.map { |name| all.find { |lb| lb.load_balancer_name == name } }
end
names(load_balancers) click to toggle source
# File lib/burdened-acrobat/load_balancers.rb, line 78
def names(load_balancers)
  Set.new load_balancers.map(&:load_balancer_name)
end
refresh!() click to toggle source
# File lib/burdened-acrobat/load_balancers.rb, line 21
def refresh!
  nil.tap do
    all!
    tags!
  end
end
tagged() click to toggle source
# File lib/burdened-acrobat/load_balancers.rb, line 58
def tagged
  Set.new all.select { |lb| names(tags).include? lb.load_balancer_name }
end
tags() click to toggle source
# File lib/burdened-acrobat/load_balancers.rb, line 38
def tags
  @tags ||= tags!
end

Private Instance Methods

all!() click to toggle source
# File lib/burdened-acrobat/load_balancers.rb, line 93
def all!
  @all = Set.new service.load_balancers!
end
service() click to toggle source
# File lib/burdened-acrobat/load_balancers.rb, line 89
def service
  @service = @options.fetch(:service) { Amazon::ELB.new }
end
tags!() click to toggle source
# File lib/burdened-acrobat/load_balancers.rb, line 97
def tags!
  @tags = Set.new service.tags!
end