Skip to content

Instantly share code, notes, and snippets.

@NilsonLima
Last active July 3, 2020 17:26
Show Gist options
  • Select an option

  • Save NilsonLima/114c38fb6903ddf24b33fc6ca83eea74 to your computer and use it in GitHub Desktop.

Select an option

Save NilsonLima/114c38fb6903ddf24b33fc6ca83eea74 to your computer and use it in GitHub Desktop.
class Smartphone::Contract::Cancel < BaseInteraction
def call
return unless valid_interaction?
if can_cancel_certificate?
return if local_certificate_canceled.success?
enqueue_cancel_remote_job
end
persist_model!
nofity_user
end
def valid_interaction?
cancelable? && suspended_subscription.success?
end
def cancelable?
#
end
def suspended_subscription
#
end
def can_cancel_certificate?
#
end
def local_certificate_canceled
#
end
def enqueue_cancel_remote_job
#
end
def persist_model!
#
end
def notify_user
#
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment