12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/labimotion/entities/element_variation_entity.rb', line 12
def variations
rows = object.variations_hash
rows.transform_values do |row|
next row unless row.is_a?(Hash)
row.symbolize_keys.slice(:uuid, :name, :properties, :metadata, :segments).tap do |slim|
slim[:properties] = (slim[:properties] || {})
slim[:metadata] = (slim[:metadata] || {}).slice('notes', 'analyses', 'group', :notes, :analyses, :group)
slim[:segments] = (slim[:segments] || {})
end
end
end
|