Last active
July 3, 2020 17:26
-
-
Save NilsonLima/114c38fb6903ddf24b33fc6ca83eea74 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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