app/models/coupdoeil/hovercard/option/animation.rb



# frozen_string_literal: true

module Coupdoeil
  class Hovercard
    class Option
      class Animation < Coupdoeil::Hovercard::Option
        self.bit_size = 3

        VALUES = %w[slide-in fade-in slide-out custom].unshift(false).freeze
        INDEX_BY_VALUES = VALUES.each_with_index.to_h.with_indifferent_access.freeze

        class << self
          def parse(value) = INDEX_BY_VALUES.fetch(value)
        end

        def validate! = validate_inclusion!
      end
    end
  end
end