Class: Decidim::NilPresenter
- Inherits:
-
Rectify::Presenter
- Object
- Rectify::Presenter
- Decidim::NilPresenter
- Defined in:
- app/presenters/decidim/nil_presenter.rb
Overview
A default presenter for the cases when the presented object is nil. For example, when there are data inconsistencies like when a Meeting which is the creator of a proposal is removed. This presenter will also be useful if the presenter for the presented object can not be resolved.
It behaves as a presenter for deleted resources. Returns an empty string for most of the method calls.
Instance Method Summary collapse
- #avatar_url ⇒ Object
- #deleted? ⇒ Boolean
-
#method_missing(_method, *_args) ⇒ Object
rubocop:disable Style/MethodMissingSuper.
- #respond_to_missing? ⇒ Boolean
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(_method, *_args) ⇒ Object
rubocop:disable Style/MethodMissingSuper
24 25 26 |
# File 'app/presenters/decidim/nil_presenter.rb', line 24 def method_missing(_method, *_args) "" end |
Instance Method Details
#avatar_url ⇒ Object
15 16 17 |
# File 'app/presenters/decidim/nil_presenter.rb', line 15 def avatar_url Decidim::AvatarUploader.new.default_url end |
#deleted? ⇒ Boolean
11 12 13 |
# File 'app/presenters/decidim/nil_presenter.rb', line 11 def deleted? true end |
#respond_to_missing? ⇒ Boolean
19 20 21 |
# File 'app/presenters/decidim/nil_presenter.rb', line 19 def respond_to_missing? true end |