-
-
Save krzkrzkrz/c581443771b3eb0cc5c1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AcceptInvite | |
def self.call(*args) | |
new(*args).call | |
end | |
include Virtus.model | |
attribute :invite, Invite | |
attribute :user, User | |
attribute :account, Account | |
attribute :time, Time, default: proc { Time.now } | |
def call | |
unless invite_already_accepted? | |
accept_invite | |
send_notification_to_inviter | |
end | |
end | |
private | |
def invite_already_accepted? | |
# ... | |
end | |
def accept_invite | |
# ... | |
end | |
def send_notification_to_inviter | |
# ... | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment