Sha256: 1d6836786fd8e37ae1af76c70d82a2c5972d577fb7ba6247269410a0b7c572af
Contents?: true
Size: 780 Bytes
Versions: 19
Compression:
Stored size: 780 Bytes
Contents
class Lono::Template::Strategy::Dsl::Builder::Section::Resource # Moves the property to the top-level attributes *destructively* class PropertyMover def initialize(resource, logical_id, properties) @resource, @logical_id, @properties = resource, logical_id, properties end def move! %w[depends_on condition].each do |attribute_name| # Account for camelize, underscore, String, and Symbol move(attribute_name.to_sym) move(attribute_name.camelize.to_sym) move(attribute_name) move(attribute_name.camelize) end end def move(attribute_name) attribute_value = @properties.delete(attribute_name) @resource[@logical_id][attribute_name] = attribute_value if attribute_value end end end
Version data entries
19 entries across 19 versions & 1 rubygems