Class: Decidim::Meetings::MeetingType
- Inherits:
-
Api::Types::BaseObject
- Object
- Api::Types::BaseObject
- Decidim::Meetings::MeetingType
- Defined in:
- lib/decidim/api/meeting_type.rb
Class Method Summary collapse
Instance Method Summary collapse
- #agenda ⇒ Object
- #audio_url ⇒ Object
- #closing_report ⇒ Object
- #coordinates ⇒ Object
- #registration_form ⇒ Object
- #video_url ⇒ Object
Class Method Details
.authorized?(object, context) ⇒ Boolean
73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/decidim/api/meeting_type.rb', line 73 def self.(object, context) context[:meeting] = object chain = [ allowed_to?(:read, :meeting, object, context), object.published?, object.current_user_can_visit_meeting?(context[:current_user]) ].all? super && chain end |
Instance Method Details
#agenda ⇒ Object
53 54 55 |
# File 'lib/decidim/api/meeting_type.rb', line 53 def agenda object.agenda if object.agenda&.visible? end |
#audio_url ⇒ Object
65 66 67 |
# File 'lib/decidim/api/meeting_type.rb', line 65 def audio_url object.audio_url if object.closing_visible? end |
#closing_report ⇒ Object
57 58 59 |
# File 'lib/decidim/api/meeting_type.rb', line 57 def closing_report object.closing_report if object.closing_visible? end |
#coordinates ⇒ Object
69 70 71 |
# File 'lib/decidim/api/meeting_type.rb', line 69 def coordinates [object.latitude, object.longitude] end |
#registration_form ⇒ Object
49 50 51 |
# File 'lib/decidim/api/meeting_type.rb', line 49 def registration_form object.questionnaire if object.registration_form_enabled? end |
#video_url ⇒ Object
61 62 63 |
# File 'lib/decidim/api/meeting_type.rb', line 61 def video_url object.video_url if object.closing_visible? end |