Class: Dsu::Presenters::ColorThemePresenter

Inherits:
BasePresenter
  • Object
show all
Defined in:
lib/dsu/presenters/color_theme_presenter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Support::ColorThemable

apply_theme, #prompt_with_options

Constructor Details

#initialize(color_theme, options: {}) ⇒ ColorThemePresenter

Returns a new instance of ColorThemePresenter.



10
11
12
13
14
# File 'lib/dsu/presenters/color_theme_presenter.rb', line 10

def initialize(color_theme, options: {})
  super

  @color_theme = color_theme
end

Instance Attribute Details

#color_themeObject (readonly)

Returns the value of attribute color_theme.



8
9
10
# File 'lib/dsu/presenters/color_theme_presenter.rb', line 8

def color_theme
  @color_theme
end

Instance Method Details

#detailObject



26
27
28
29
# File 'lib/dsu/presenters/color_theme_presenter.rb', line 26

def detail
  "#{apply_theme(theme_name_formatted, theme_color: color_theme.body)} - " \
    "#{apply_theme(description, theme_color: color_theme.body)}"
end

#detail_with_index(index:) ⇒ Object



31
32
33
# File 'lib/dsu/presenters/color_theme_presenter.rb', line 31

def detail_with_index(index:)
  "#{formatted_index(index: index)} #{detail}"
end


21
22
23
24
# File 'lib/dsu/presenters/color_theme_presenter.rb', line 21

def footer
  header = I18n.t('presenters.color_theme_presenter.headers.current_theme')
  apply_theme(header, theme_color: color_theme.footer)
end

#headerObject



16
17
18
19
# File 'lib/dsu/presenters/color_theme_presenter.rb', line 16

def header
  header = I18n.t('presenters.color_theme_presenter.headers.color_themes')
  apply_theme(header, theme_color: color_theme.subheader)
end