Class: Decidim::ConferenceSpeakerPresenter
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Decidim::ConferenceSpeakerPresenter
- Includes:
- ResourceHelper
- Defined in:
- app/presenters/decidim/conference_speaker_presenter.rb
Overview
Decorator for conference speakers
Instance Method Summary collapse
- #avatar ⇒ Object
- #avatar_url(variant = nil) ⇒ Object
- #badge ⇒ Object
- #can_be_contacted? ⇒ Boolean
- #deleted? ⇒ Boolean
- #has_tooltip? ⇒ Boolean
- #name ⇒ Object
- #nickname ⇒ Object
Instance Method Details
#avatar ⇒ Object
36 37 38 |
# File 'app/presenters/decidim/conference_speaker_presenter.rb', line 36 def avatar attached_uploader(:avatar) end |
#avatar_url(variant = nil) ⇒ Object
40 41 42 43 44 |
# File 'app/presenters/decidim/conference_speaker_presenter.rb', line 40 def avatar_url(variant = nil) return avatar.default_url unless avatar.attached? avatar.path(variant:) end |
#badge ⇒ Object
24 25 26 |
# File 'app/presenters/decidim/conference_speaker_presenter.rb', line 24 def badge user ? user.badge : false end |
#can_be_contacted? ⇒ Boolean
28 29 30 |
# File 'app/presenters/decidim/conference_speaker_presenter.rb', line 28 def can_be_contacted? user ? true : false end |
#deleted? ⇒ Boolean
20 21 22 |
# File 'app/presenters/decidim/conference_speaker_presenter.rb', line 20 def deleted? user ? user.deleted? : false end |
#has_tooltip? ⇒ Boolean
32 33 34 |
# File 'app/presenters/decidim/conference_speaker_presenter.rb', line 32 def has_tooltip? false end |
#name ⇒ Object
12 13 14 |
# File 'app/presenters/decidim/conference_speaker_presenter.rb', line 12 def name user ? user.name : full_name end |
#nickname ⇒ Object
16 17 18 |
# File 'app/presenters/decidim/conference_speaker_presenter.rb', line 16 def nickname user.nickname if user end |