Class: Decidim::NilPresenter

Inherits:
Rectify::Presenter
  • Object
show all
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

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(_method, *_args) ⇒ Object



23
24
25
# File 'app/presenters/decidim/nil_presenter.rb', line 23

def method_missing(_method, *_args)
  ""
end

Instance Method Details

#avatar_urlObject



15
16
17
# File 'app/presenters/decidim/nil_presenter.rb', line 15

def avatar_url
  Decidim::AvatarUploader.new.default_url
end

#deleted?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'app/presenters/decidim/nil_presenter.rb', line 11

def deleted?
  true
end

#respond_to_missing?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'app/presenters/decidim/nil_presenter.rb', line 19

def respond_to_missing?
  true
end