Class: Dsu::Presenters::ConfigurationPresenter
- Inherits:
-
BasePresenter
- Object
- SimpleDelegator
- BasePresenter
- Dsu::Presenters::ConfigurationPresenter
- Defined in:
- lib/dsu/presenters/configuration_presenter.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Attributes inherited from BasePresenter
Instance Method Summary collapse
- #configuration_details ⇒ Object
- #configuration_header ⇒ Object
-
#initialize(config, options: {}) ⇒ ConfigurationPresenter
constructor
A new instance of ConfigurationPresenter.
Methods included from Support::ColorThemable
apply_theme, #prompt_with_options
Constructor Details
#initialize(config, options: {}) ⇒ ConfigurationPresenter
Returns a new instance of ConfigurationPresenter.
12 13 14 15 16 |
# File 'lib/dsu/presenters/configuration_presenter.rb', line 12 def initialize(config, options: {}) super @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
10 11 12 |
# File 'lib/dsu/presenters/configuration_presenter.rb', line 10 def config @config end |
Instance Method Details
#configuration_details ⇒ Object
23 24 25 26 27 |
# File 'lib/dsu/presenters/configuration_presenter.rb', line 23 def configuration_details to_h.each_with_index.filter_map do |config_entry, index| formatted_config_entry_with_index(config_entry, index: index, theme_color: color_theme.body) end end |
#configuration_header ⇒ Object
18 19 20 21 |
# File 'lib/dsu/presenters/configuration_presenter.rb', line 18 def configuration_header header = I18n.t('presenters.configuration_presenter.headers.file_contents', config_path: config_path) apply_theme(header, theme_color: color_theme.header) end |