Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save NilsonLima/c12770e83a393d1a1e220d34369f7560 to your computer and use it in GitHub Desktop.
class Smartphone::Contract::Change < BaseInteraction
def call
return unless valid_interaction?
persist_models!
change_certificate
end
def valid_interaction?
not_suspended?
&& invoices_settled?
&& previous_attributes_valid?
&& new_attributes_valid?
&& suspended_subscription.success?
end
def not_suspended?
#
end
def invoices_settled?
#
end
def previous_attributes_valid?
#
end
def new_attributes_valid?
#
end
def suspended_subscription
#
end
def change_certificate
#
end
def persist_models!
#
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment