Sha256: 6f68821b5b7ab30befb025a47ca38561ab3e66bbfbf2b37684b0c8b267e0e874

Contents?: true

Size: 488 Bytes

Versions: 1

Compression:

Stored size: 488 Bytes

Contents

# frozen_string_literal: true

module Formats
  class ColorTheme
    include EnumField::DefineEnum

    attr_reader :code, :css

    def initialize(code, css = nil)
      @code = code.to_sym
      @css = css.nil? ? @code.to_s : css
    end

    def title
      I18n.t(code, scope: [:formats, :color_theme])
    end

    define_enum do |builder|
      builder.member :blue, object: new(:blue, 'theme_blue')
      builder.member :green, object: new(:green, 'theme_green')
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
translation_cms-0.1.5 app/models/formats/color_theme.rb