mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-24 23:16:22 +00:00
13 lines
287 B
Ruby
13 lines
287 B
Ruby
# frozen_string_literal: true
|
|
|
|
# Implementa valores por sí o por no
|
|
class MetadataBoolean < MetadataTemplate
|
|
def default_value
|
|
false
|
|
end
|
|
|
|
# Convertir el valor que pasemos a boolean
|
|
def value
|
|
self[:value].present? || document.data.fetch('draft', default_value)
|
|
end
|
|
end
|