Class: PagesCore::DestroyInviteService

Inherits:
Object
  • Object
show all
Defined in:
app/services/pages_core/destroy_invite_service.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(invite:) ⇒ DestroyInviteService

Returns a new instance of DestroyInviteService.



7
8
9
# File 'app/services/pages_core/destroy_invite_service.rb', line 7

def initialize(invite:)
  @invite = invite
end

Instance Attribute Details

#inviteObject (readonly)

Returns the value of attribute invite.



5
6
7
# File 'app/services/pages_core/destroy_invite_service.rb', line 5

def invite
  @invite
end

Class Method Details

.call(invite:) ⇒ Object



12
13
14
# File 'app/services/pages_core/destroy_invite_service.rb', line 12

def call(invite:)
  new(invite: invite).call
end

Instance Method Details

#callObject



17
18
19
20
21
22
23
# File 'app/services/pages_core/destroy_invite_service.rb', line 17

def call
  Invite.transaction do
    invite.destroy
    PagesCore::PubSub.publish(:destroy_invite, invite: invite)
    invite
  end
end