Sha256: 57b9f0f4ae8ee64fd71e59f178f24ba833c6a59252c765a1e13389e8b6de1e3a
Contents?: true
Size: 798 Bytes
Versions: 31
Compression:
Stored size: 798 Bytes
Contents
# Implements: # # template - uses @definition to build a CloudFormation template section # class Lono::Template::Dsl::Builder class Condition < Base def template camelize(standarize(@definition)) end # There are only 2 forms for condition: long and medium # # Type is the only required property: https://amzn.to/2x8W5aD def standarize(definition) first, second, _ = definition if definition.size == 1 && first.is_a?(Hash) # long form first # pass through elsif definition.size == 2 && second.is_a?(Hash) # medium form logical_id, properties = first, second { logical_id => properties } else # I dont know what form raise "Invalid form provided. definition #{definition.inspect}" end end end end
Version data entries
31 entries across 31 versions & 1 rubygems