Sha256: 07161b4273f1d8eb139cc1b7a0b61aa8df7cf0e2e21fc803c95130cb665baed7
Contents?: true
Size: 1.04 KB
Versions: 21
Compression:
Stored size: 1.04 KB
Contents
class Jets::Resource extend Memoist attr_reader :definition, :replacements def initialize(definition, replacements={}) @definition = definition @replacements = replacements end def template standarize(definition) end memoize :template # CloudFormation Resources reference: https://amzn.to/2NKg6ip def standarize(*definition) Standardizer.new(definition).template end def logical_id id = template.keys.first # replace possible {namespace} in the logical id id = replacer.replace_value(id) Jets::Camelizer.camelize(id) end def type attributes['Type'] end def properties attributes['Properties'] end def attributes attributes = template.values.first attributes = replacer.replace_placeholders(attributes) Jets::Camelizer.transform(attributes) end def parameters {} end def outputs {} end def replacer Replacer.new(replacements) end memoize :replacer def permission Permission.new(replacements, self) end memoize :permission end
Version data entries
21 entries across 21 versions & 1 rubygems