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
81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/decidim/api/meeting_type.rb', line 81 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
26 27 28 |
# File 'lib/decidim/api/meeting_type.rb', line 26 def agenda object.agenda if object.agenda&.visible? end |
#audio_url ⇒ Object
44 45 46 |
# File 'lib/decidim/api/meeting_type.rb', line 44 def audio_url object.audio_url if object.closing_visible? end |
#closing_report ⇒ Object
36 37 38 |
# File 'lib/decidim/api/meeting_type.rb', line 36 def closing_report object.closing_report if object.closing_visible? end |
#coordinates ⇒ Object
74 75 76 |
# File 'lib/decidim/api/meeting_type.rb', line 74 def coordinates [object.latitude, object.longitude] end |
#registration_form ⇒ Object
66 67 68 |
# File 'lib/decidim/api/meeting_type.rb', line 66 def registration_form object.questionnaire if object.registration_form_enabled? end |
#video_url ⇒ Object
40 41 42 |
# File 'lib/decidim/api/meeting_type.rb', line 40 def video_url object.video_url if object.closing_visible? end |