mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-17 05:26:21 +00:00
22 lines
304 B
Ruby
22 lines
304 B
Ruby
# frozen_string_literal: true
|
|
|
|
# Un campo numérico
|
|
class MetadataNumber < MetadataTemplate
|
|
# Nada
|
|
def default_value
|
|
nil
|
|
end
|
|
|
|
def save
|
|
self[:value] = value.to_i
|
|
self[:value] = encrypt(value) if private?
|
|
|
|
true
|
|
end
|
|
|
|
private
|
|
|
|
def decrypt(value)
|
|
super(value).to_i
|
|
end
|
|
end
|