Sha256: 933087bb4f6c6786981bc37f17ea7ca75d6b5e6abce47e70d60f33e53efb820d
Contents?: true
Size: 794 Bytes
Versions: 10
Compression:
Stored size: 794 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[Condition DeletionPolicy DependsOn].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
10 entries across 10 versions & 1 rubygems