Skip to content

Instantly share code, notes, and snippets.

@rpond-pa
Created April 25, 2014 17:34
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 rpond-pa/11297268 to your computer and use it in GitHub Desktop.
Save rpond-pa/11297268 to your computer and use it in GitHub Desktop.
def randys_version(current_url)
e = ->(e) { e.tr "A-Za-z", "N-ZA-Mn-za-m" }
vs = [freak=e.('ue_fhvgr'),e.('nccyvpnag_cbegny')]
z = ->(w,i) { w.split(e.('_'))[i] }
ks = vs.map.with_index {|zi,i| z.(zi,i) }
Hash[ks.zip(vs)][current_url] || vs[1]
end
booty = ->(t) { t ? nil : throw(:whoops) }
booty.call randys_version 'portal' == 'applicant_portal'
booty.call randys_version 'hr' == 'hr_suite'
booty.call randys_version 'tgif' == 'applicant_portal'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment