Class: Kelbim::Exporter
- Inherits:
-
Object
- Object
- Kelbim::Exporter
- Includes:
- Utils::Helper
- Defined in:
- lib/kelbim/exporter.rb
Class Method Summary collapse
Instance Method Summary collapse
- #export ⇒ Object
-
#initialize(elb, options = {}) ⇒ Exporter
constructor
of class methods.
Methods included from Utils::Helper
Constructor Details
#initialize(elb, options = {}) ⇒ Exporter
of class methods
11 12 13 14 |
# File 'lib/kelbim/exporter.rb', line 11 def initialize(elb, = {}) @elb = elb @options = end |
Class Method Details
.export(elb, options = {}) ⇒ Object
6 7 8 |
# File 'lib/kelbim/exporter.rb', line 6 def export(elb, = {}) self.new(elb, ).export end |
Instance Method Details
#export ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/kelbim/exporter.rb', line 16 def export result = {} lbs = @elb.load_balancers ec2s = @options[:ec2s] if ec2s or @options[:elb_name] or @options[:exclude_elb_name] lbs = lbs.select do |lb| (ec2s.nil? or ec2s.include?(lb.vpc_id || 'classic')) && matched_elb?(lb.name) end end lbs.each do |lb| result[lb.vpc_id] ||= {} result[lb.vpc_id][lb.name] = export_load_balancer(lb) end return result end |