Skip to content

Instantly share code, notes, and snippets.

@stim371
Created December 8, 2011 08:11
Show Gist options
  • Save stim371/1446435 to your computer and use it in GitHub Desktop.
Save stim371/1446435 to your computer and use it in GitHub Desktop.
callback to enter the proper expiration date for the option contract being saved
def calc_exp_date
expirationdate.wday == 6 ? self.expirationdate = expirationdate+(21) : self.expirationdate = expirationdate+(14 + 6 - expirationdate.wday)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment