Sha256: 85f24aaea9c8255953c10082decff35fef7b2b6f71a69c7ab181716667a7950f

Contents?: true

Size: 662 Bytes

Versions: 15

Compression:

Stored size: 662 Bytes

Contents

require 'sfn'

module Sfn
  module MonkeyPatch
    module Stack
      # Azure specific monkey patch implementations
      module Azure

        # @return [Hash] restructured azure template
        # @note Will return #template if name collision encountered within resources
        def sparkleish_template_azure
          new_template = template.to_smash
          resources = new_template.delete(:resources)
          resources.each do |resource|
            new_template.set(:resources, resource.delete(:name), resource)
          end
          resources.size == new_template[:resources].size ? new_template : template
        end

      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
sfn-3.0.28 lib/sfn/monkey_patch/stack/azure.rb
sfn-3.0.26 lib/sfn/monkey_patch/stack/azure.rb
sfn-3.0.24 lib/sfn/monkey_patch/stack/azure.rb
sfn-3.0.22 lib/sfn/monkey_patch/stack/azure.rb
sfn-3.0.20 lib/sfn/monkey_patch/stack/azure.rb
sfn-3.0.18 lib/sfn/monkey_patch/stack/azure.rb
sfn-3.0.16 lib/sfn/monkey_patch/stack/azure.rb
sfn-3.0.14 lib/sfn/monkey_patch/stack/azure.rb
sfn-3.0.12 lib/sfn/monkey_patch/stack/azure.rb
sfn-3.0.10 lib/sfn/monkey_patch/stack/azure.rb
sfn-3.0.8 lib/sfn/monkey_patch/stack/azure.rb
sfn-3.0.6 lib/sfn/monkey_patch/stack/azure.rb
sfn-3.0.4 lib/sfn/monkey_patch/stack/azure.rb
sfn-3.0.2 lib/sfn/monkey_patch/stack/azure.rb
sfn-3.0.0 lib/sfn/monkey_patch/stack/azure.rb