Class: Dsu::Presenters::EntryPresenter

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

Instance Attribute Summary collapse

Attributes inherited from BasePresenter

#color_theme

Instance Method Summary collapse

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

#entryObject (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_descriptionObject



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