Skip to content

Instantly share code, notes, and snippets.

@keitaj
Created March 17, 2015 08:46
Show Gist options
  • Save keitaj/e9bd67bb3d4743c000b6 to your computer and use it in GitHub Desktop.
Save keitaj/e9bd67bb3d4743c000b6 to your computer and use it in GitHub Desktop.
# ユーザーの入力が1ならBarから、そうでなければBazから派生する
class Foo < (user_input == "1" ? Bar : Baz)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment