Class: Dsu::Presenters::ColorThemeShowPresenter
- Inherits:
-
BasePresenter
- Object
- SimpleDelegator
- BasePresenter
- Dsu::Presenters::ColorThemeShowPresenter
show all
- Defined in:
- lib/dsu/presenters/color_theme_show_presenter.rb
Instance Attribute Summary
#color_theme
Instance Method Summary
collapse
apply_theme, #prompt_with_options
Constructor Details
8
9
10
|
# File 'lib/dsu/presenters/color_theme_show_presenter.rb', line 8
def initialize(color_theme, options: {})
super(color_theme, options: options.merge(theme_name: color_theme.theme_name))
end
|
Instance Method Details
#detail ⇒ Object
12
13
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/dsu/presenters/color_theme_show_presenter.rb', line 12
def detail
= [I18n.t('presenters.color_theme_show_presenter.headers.number'),
I18n.t('presenters.color_theme_show_presenter.headers.color'),
I18n.t('presenters.color_theme_show_presenter.headers.values')]
puts_detail(*, header: true)
Models::ColorTheme::DEFAULT_THEME_COLORS.keys.each_with_index do |color_key, index|
index = formatted_index(index: index)
color_hash = color_theme.public_send(color_key)
puts_detail(index, color_key, color_hash)
end
end
|
#detail_with_index(index:) ⇒ Object
25
26
27
|
# File 'lib/dsu/presenters/color_theme_show_presenter.rb', line 25
def detail_with_index(index:)
"#{formatted_index(index: index)} #{detail}"
end
|
29
30
31
32
|
# File 'lib/dsu/presenters/color_theme_show_presenter.rb', line 29
def
= I18n.t('presenters.color_theme_show_presenter.headers.footer_example')
apply_theme(, theme_color: color_theme.)
end
|
34
35
36
37
38
|
# File 'lib/dsu/presenters/color_theme_show_presenter.rb', line 34
def
= I18n.t('presenters.color_theme_show_presenter.headers.viewing_color_theme',
theme_name: color_theme.theme_name)
apply_theme(, theme_color: color_theme.)
end
|