Class: Decidim::MetricChartsPresenter
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Decidim::MetricChartsPresenter
- Defined in:
- app/presenters/decidim/metric_charts_presenter.rb
Overview
A presenter to render metrics in pages
Instance Method Summary collapse
-
#highlighted ⇒ Object
Public: Render a collection of primary metrics.
- #highlighted_metrics ⇒ Object
-
#not_highlighted ⇒ Object
Public: Render a collection of metrics that are not primary.
- #not_highlighted_metrics ⇒ Object
- #view_context ⇒ Object
Instance Method Details
#highlighted ⇒ Object
Public: Render a collection of primary metrics.
13 14 15 |
# File 'app/presenters/decidim/metric_charts_presenter.rb', line 13 def highlighted render_highlighted(highlighted_metrics) end |
#highlighted_metrics ⇒ Object
22 23 24 |
# File 'app/presenters/decidim/metric_charts_presenter.rb', line 22 def highlighted_metrics Decidim.metrics_registry.filtered(highlight: true, scope: "home") end |
#not_highlighted ⇒ Object
Public: Render a collection of metrics that are not primary.
18 19 20 |
# File 'app/presenters/decidim/metric_charts_presenter.rb', line 18 def not_highlighted render_not_highlighted(not_highlighted_metrics) end |
#not_highlighted_metrics ⇒ Object
26 27 28 |
# File 'app/presenters/decidim/metric_charts_presenter.rb', line 26 def not_highlighted_metrics Decidim.metrics_registry.filtered(highlight: false, scope: "home") end |
#view_context ⇒ Object
8 9 10 |
# File 'app/presenters/decidim/metric_charts_presenter.rb', line 8 def view_context @view_context ||= __getobj__.fetch(:view_context, ActionController::Base.new.view_context) end |