Sha256: a0fc6beb3cbc126f78973f6cedbbfe5201ee7ba9a93a0a04e6ad573494c7b7d5
Contents?: true
Size: 653 Bytes
Versions: 12
Compression:
Stored size: 653 Bytes
Contents
require 'yaml' require 'net/http' require 'uri' # Cfnlego module Cfnlego # Resource class Resource attr_reader :type, :name def initialize(type, name) @type = type @name = name end def attributes definition['Attributes'] end def properties definition['Properties'] end private def definition content = Cfnlego.fetch_resource_content datainput = JSON.parse(content) data = datainput['ResourceTypes'] begin @definition ||= data[@type] rescue RuntimeError raise "unknown #{@type}, no matching definition found" end end end end
Version data entries
12 entries across 12 versions & 1 rubygems