demarches-normaliennes/app/models/logic/empty.rb

31 lines
395 B
Ruby
Raw Normal View History

2022-06-09 11:54:29 +02:00
class Logic::Empty < Logic::Term
2022-07-05 14:37:53 +02:00
def initialize(id = nil)
super(id)
end
2022-06-27 12:32:00 +02:00
def to_s = I18n.t('logic.empty')
2022-06-09 11:54:29 +02:00
def type = :empty
def errors(_stable_ids = nil) = ['empty']
def to_h
{
2022-07-05 14:37:53 +02:00
"op" => self.class.name,
"id" => @id
2022-06-09 11:54:29 +02:00
}
end
2022-07-05 14:37:53 +02:00
def self.from_h(h)
self.new(h['id'])
2022-06-09 11:54:29 +02:00
end
def ==(other)
self.class == other.class
end
2022-06-27 16:21:30 +02:00
def value
nil
end
2022-06-09 11:54:29 +02:00
end