Sha256: c03aa2393908e3cee0487d6be2b26d54422138243cbde82cf9389390cc44317e
Contents?: true
Size: 735 Bytes
Versions: 6
Compression:
Stored size: 735 Bytes
Contents
module Humidifier # Represents a CFN stack parameter class Parameter # The allowed properties of all stack parameters PROPERTIES = Utils.underscored(%w[AllowedPattern AllowedValues ConstraintDescription Default Description MaxLength MaxValue MinLength MinValue NoEcho]) attr_accessor :type, *PROPERTIES.values def initialize(opts = {}) PROPERTIES.values.each { |prop| send(:"#{prop}=", opts[prop]) } self.type = opts.fetch(:type, 'String') end # CFN stack syntax def to_cf cf = { 'Type' => type } PROPERTIES.each do |name, prop| val = send(prop) cf[name] = Serializer.dump(val) if val end cf end end end
Version data entries
6 entries across 6 versions & 1 rubygems