Skip to content

Instantly share code, notes, and snippets.

@ArunYogeshwaran
Created July 6, 2023 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ArunYogeshwaran/76a437c98be70889ea8e5cd73c29ebf8 to your computer and use it in GitHub Desktop.
Save ArunYogeshwaran/76a437c98be70889ea8e5cd73c29ebf8 to your computer and use it in GitHub Desktop.
The example below shows a class that contains the logic of a feature in an app where a user can invite another user based on certain internal conditions.
fun referFriend(userId: String, referral: Referral) {
if (isReferralValid(referral)) {
processReferral(userId)
}
}
private fun isReferralValid(referral: Referral): Boolean {
  // Checks the validity of the referral.
}
private fun processReferral(userId: String) {
 // Processes the referral.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment