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

30 lines
397 B
Ruby
Raw Normal View History

2022-06-09 11:54:29 +02:00
class Logic::Empty < Logic::Term
2023-01-04 11:10:10 +01:00
def sources
[]
end
2022-09-26 21:21:55 +02:00
def to_s(_type_de_champs = []) = I18n.t('logic.empty')
2022-06-09 11:54:29 +02:00
2022-09-26 21:07:43 +02:00
def type(_type_de_champs = []) = :empty
2022-06-09 11:54:29 +02:00
2022-09-26 21:11:43 +02:00
def errors(_type_de_champs = []) = ['empty']
2022-06-09 11:54:29 +02:00
def to_h
{
"term" => self.class.name
2022-06-09 11:54:29 +02:00
}
end
def self.from_h(_h)
self.new
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