Class: Dsu::Presenters::EntryPresenter
- Inherits:
-
BasePresenter
- Object
- SimpleDelegator
- BasePresenter
- Dsu::Presenters::EntryPresenter
- Defined in:
- lib/dsu/presenters/entry_presenter.rb
Instance Attribute Summary collapse
-
#entry ⇒ Object
readonly
Returns the value of attribute entry.
Attributes inherited from BasePresenter
Instance Method Summary collapse
- #formatted_description ⇒ Object
- #formatted_description_with_index(index:) ⇒ Object
-
#initialize(entry, options: {}) ⇒ EntryPresenter
constructor
A new instance of EntryPresenter.
Methods included from Support::ColorThemable
apply_theme, #prompt_with_options
Constructor Details
#initialize(entry, options: {}) ⇒ EntryPresenter
Returns a new instance of EntryPresenter.
10 11 12 13 14 |
# File 'lib/dsu/presenters/entry_presenter.rb', line 10 def initialize(entry, options: {}) super @entry = entry end |
Instance Attribute Details
#entry ⇒ Object (readonly)
Returns the value of attribute entry.
8 9 10 |
# File 'lib/dsu/presenters/entry_presenter.rb', line 8 def entry @entry end |
Instance Method Details
#formatted_description ⇒ Object
16 17 18 |
# File 'lib/dsu/presenters/entry_presenter.rb', line 16 def formatted_description apply_theme(description, theme_color: color_theme.body) end |
#formatted_description_with_index(index:) ⇒ Object
20 21 22 |
# File 'lib/dsu/presenters/entry_presenter.rb', line 20 def formatted_description_with_index(index:) "#{formatted_index(index: index)} #{formatted_description}" end |