Sha256: 9bc30bc12bc971f946a51c8e009e6cb18dfe53b558088ebf0643e64b0e1d17f7

Contents?: true

Size: 545 Bytes

Versions: 4

Compression:

Stored size: 545 Bytes

Contents

require 'erb'

module Applb
  class Converter
    def initialize(lbs_by_vpc_id, tags_by_arn)
      @lbs_by_vpc_id = lbs_by_vpc_id
      @tags_by_arn = tags_by_arn
    end

    def convert
      @lbs_by_vpc_id.each do |vpc_id, lbs_by_name|
        yield vpc_id, output_alb(vpc_id, @tags_by_arn, lbs_by_name)
      end
    end

    private

    def output_alb(vpc_id, tags_by_arn, lbs_by_name)
      path = Pathname.new(File.expand_path('../', __FILE__)).join('output_alb.erb')
      ERB.new(path.read, nil, '-').result(binding)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
applb-0.1.5.beta1 lib/applb/converter.rb
applb-0.1.4 lib/applb/converter.rb
applb-0.1.3 lib/applb/converter.rb
applb-0.1.2 lib/applb/converter.rb