5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-16 10:51:42 +00:00

hacer más claro el código

This commit is contained in:
f 2021-10-21 10:48:34 -03:00
parent 090b630525
commit d67d43ff1e

View file

@ -25,10 +25,14 @@ class MetadataBoolean < MetadataTemplate
# * false
# * true
def value
return document.data.fetch(name.to_s, default_value) if self[:value].nil?
return self[:value] unless self[:value].is_a? String
self[:value] = true_values.include? self[:value]
case self[:value]
when NilClass
document.data.fetch(name.to_s, default_value)
when String
true_values.include? self[:value]
else
self[:value]
end
end
# Siempre guardar el valor de este campo a menos que sea nulo