Sha256: 52ca22eadbb9492f3f492c4abd3b70635cf934222cce893c63105461d1ad98de
Contents?: true
Size: 714 Bytes
Versions: 14
Compression:
Stored size: 714 Bytes
Contents
require 'yaml' module Cfnlego class Resource attr_reader :type, :name def initialize(type, name) @type = type @name = name end def attributes definition["#{@type}"]["Attributes"] end def properties definition["#{@type}"]['Properties'] end private # example AutoScaling::AutoScalingGroup def type2file @file ||= "#{File.realpath(File.dirname(__FILE__))}/resources/#{@type.gsub(/::/, File::SEPARATOR)}.yaml" end def definition if File::exists?(type2file) @definition ||= YAML.load_file(type2file) else raise RuntimeError, "unknown #{@type}, no matching definition found" end end end end
Version data entries
14 entries across 14 versions & 1 rubygems