Sha256: d559bf7651919476c8fbdf11538d100f8963b9a5e0e0fe25c167f3ddd7fe281d

Contents?: true

Size: 470 Bytes

Versions: 1

Compression:

Stored size: 470 Bytes

Contents

require "aws/cfn/yats/base"
require 'yaml'

module Aws
  module Cfn
    module Yats

      class Yaml2Json < Base
        attr_accessor :yaml

        def transform(template)
          @template = template
          @yaml     = YAML.load(template)
          @simple   = simplify(@yaml)
          pprint(@simple)
        end

        def pprint_cfn_template(tpl)

          @json = JSON.pretty_generate(tpl)

          puts @json
        end

      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
aws-cfn-yats-0.0.4 lib/aws/cfn/yats/yaml2json.rb