Class: Decidim::Meetings::Admin::MarkAsAttendee

Inherits:
Command
  • Object
show all
Defined in:
decidim-meetings/app/commands/decidim/meetings/admin/mark_as_attendee.rb

Overview

This command is executed when the user marks a registration as attendee from the admin panel.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Command

call, #evaluate, #method_missing, #respond_to_missing?, #transaction, #with_events

Constructor Details

#initialize(registration) ⇒ MarkAsAttendee

Returns a new instance of MarkAsAttendee.



9
10
11
# File 'decidim-meetings/app/commands/decidim/meetings/admin/mark_as_attendee.rb', line 9

def initialize(registration)
  @registration = registration
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Decidim::Command

Instance Attribute Details

#registrationObject (readonly)

Returns the value of attribute registration.



22
23
24
# File 'decidim-meetings/app/commands/decidim/meetings/admin/mark_as_attendee.rb', line 22

def registration
  @registration
end

Instance Method Details

#callObject



13
14
15
16
17
18
19
20
# File 'decidim-meetings/app/commands/decidim/meetings/admin/mark_as_attendee.rb', line 13

def call
  return broadcast(:invalid) if registration.validated?

  mark_attendee
  send_notification

  broadcast(:ok)
end