Class: Formats::ColorTheme
- Inherits:
-
Object
- Object
- Formats::ColorTheme
- Includes:
- EnumField::DefineEnum
- Defined in:
- app/models/formats/color_theme.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#css ⇒ Object
readonly
Returns the value of attribute css.
Instance Method Summary collapse
-
#initialize(code, css = nil) ⇒ ColorTheme
constructor
A new instance of ColorTheme.
- #title ⇒ Object
Constructor Details
#initialize(code, css = nil) ⇒ ColorTheme
Returns a new instance of ColorTheme.
9 10 11 12 |
# File 'app/models/formats/color_theme.rb', line 9 def initialize(code, css = nil) @code = code.to_sym @css = css.nil? ? @code.to_s : css end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
7 8 9 |
# File 'app/models/formats/color_theme.rb', line 7 def code @code end |
#css ⇒ Object (readonly)
Returns the value of attribute css.
7 8 9 |
# File 'app/models/formats/color_theme.rb', line 7 def css @css end |
Instance Method Details
#title ⇒ Object
14 15 16 |
# File 'app/models/formats/color_theme.rb', line 14 def title I18n.t(code, scope: [:formats, :color_theme]) end |