2019-08-06 17:54:17 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
# Una lista de valores
|
|
|
|
class MetadataArray < MetadataTemplate
|
|
|
|
# El valor por defecto es una array vacía
|
|
|
|
def default_value
|
2020-11-11 18:29:12 +00:00
|
|
|
super || []
|
2019-08-06 17:54:17 +00:00
|
|
|
end
|
2019-08-13 23:33:57 +00:00
|
|
|
|
2020-02-12 21:24:54 +00:00
|
|
|
private
|
|
|
|
|
|
|
|
def sanitize(values)
|
|
|
|
values.map do |v|
|
|
|
|
if v.is_a? String
|
2020-04-15 13:13:38 +00:00
|
|
|
super(v).sub(/\.\z/, '')
|
2020-02-12 21:24:54 +00:00
|
|
|
else
|
|
|
|
v
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2019-08-06 17:54:17 +00:00
|
|
|
end
|