Skip to content

Instantly share code, notes, and snippets.

@patmaddox
Created February 4, 2014 22:03
Show Gist options
  • Select an option

  • Save patmaddox/8813262 to your computer and use it in GitHub Desktop.

Select an option

Save patmaddox/8813262 to your computer and use it in GitHub Desktop.
something = case option_type
when OptionType then "do this"
when String then "do this thing"
else "how about this"
end
something = if option_type.class == OptionType
"do this"
elsif option_type.class == String
"do this thing"
else
"how about this"
end
if option_type.class == OptionType
something = "do this"
elsif option_type.class == String
something = "do this thing"
else
something = "how about this"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment