Class: Dsu::Views::BaseListView
- Inherits:
-
Object
- Object
- Dsu::Views::BaseListView
- Includes:
- Support::ColorThemable
- Defined in:
- lib/dsu/views/base_list_view.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#presenter ⇒ Object
readonly
Returns the value of attribute presenter.
Instance Method Summary collapse
-
#initialize(presenter:, options: {}) ⇒ BaseListView
constructor
A new instance of BaseListView.
- #render ⇒ Object
Methods included from Support::ColorThemable
apply_theme, #prompt_with_options
Constructor Details
#initialize(presenter:, options: {}) ⇒ BaseListView
Returns a new instance of BaseListView.
14 15 16 17 18 |
# File 'lib/dsu/views/base_list_view.rb', line 14 def initialize(presenter:, options: {}) @presenter = presenter = &.dup || {} @color_theme = Models::ColorTheme.find(theme_name: theme_name) end |
Instance Attribute Details
#presenter ⇒ Object (readonly)
Returns the value of attribute presenter.
12 13 14 |
# File 'lib/dsu/views/base_list_view.rb', line 12 def presenter @presenter end |
Instance Method Details
#render ⇒ Object
20 21 22 23 24 25 |
# File 'lib/dsu/views/base_list_view.rb', line 20 def render yield rescue StandardError => e puts apply_theme(e., theme_color: color_theme.error) puts apply_theme(e.backtrace_locations.join("\n"), theme_color: color_theme.error) if Dsu.env.local? end |