Class: Dsu::Presenters::EntryGroupPresenter
- Inherits:
-
BasePresenter
- Object
- SimpleDelegator
- BasePresenter
- Dsu::Presenters::EntryGroupPresenter
- Defined in:
- lib/dsu/presenters/entry_group_presenter.rb
Instance Attribute Summary collapse
-
#entry_group ⇒ Object
readonly
Returns the value of attribute entry_group.
Attributes inherited from BasePresenter
Instance Method Summary collapse
- #formatted_errors ⇒ Object
- #formatted_time ⇒ Object
-
#initialize(entry_group, options: {}) ⇒ EntryGroupPresenter
constructor
A new instance of EntryGroupPresenter.
- #no_entries_available ⇒ Object
Methods included from Support::ColorThemable
apply_theme, #prompt_with_options
Constructor Details
#initialize(entry_group, options: {}) ⇒ EntryGroupPresenter
Returns a new instance of EntryGroupPresenter.
11 12 13 14 15 |
# File 'lib/dsu/presenters/entry_group_presenter.rb', line 11 def initialize(entry_group, options: {}) super @entry_group = entry_group end |
Instance Attribute Details
#entry_group ⇒ Object (readonly)
Returns the value of attribute entry_group.
9 10 11 |
# File 'lib/dsu/presenters/entry_group_presenter.rb', line 9 def entry_group @entry_group end |
Instance Method Details
#formatted_errors ⇒ Object
22 23 24 25 26 27 |
# File 'lib/dsu/presenters/entry_group_presenter.rb', line 22 def formatted_errors return if valid? colors = color_theme.error apply_theme(errors..join(', '), theme_color: colors) end |
#formatted_time ⇒ Object
17 18 19 20 |
# File 'lib/dsu/presenters/entry_group_presenter.rb', line 17 def formatted_time colors = color_theme.date apply_theme(Support::TimeFormatable.formatted_time(time: time), theme_color: colors) end |
#no_entries_available ⇒ Object
29 30 31 32 |
# File 'lib/dsu/presenters/entry_group_presenter.rb', line 29 def no_entries_available header = I18n.t('presenters.entry_group_presenter.headers.no_entries_available') apply_theme(header, theme_color: color_theme.info) end |