Skip to content

Instantly share code, notes, and snippets.

@844196
Last active January 29, 2016 14:31
Show Gist options
  • Save 844196/e621dbdb530c2bf39367 to your computer and use it in GitHub Desktop.
Save 844196/e621dbdb530c2bf39367 to your computer and use it in GitHub Desktop.
殺さないでください
殺人 =-> したこと { したこと =~ /殺人/ }
殺人じゃないやつ =-> したこと { 殺人.(したこと).! }
その子何したんだろうね? =-> したこと {
case したこと
when 殺人
'アホか!むしろ怒れるか!'
when 殺人じゃないやつ
'広い!'
end
}
その子何したんだろうね?.('殺人')
#=> アホか!むしろ怒れるか!
その子何したんだろうね?.('北海道')
#=> 広い!
その子何したんだろうね? =-> したこと {
したこと =~ /殺人/ ? 'アホか!むしろ怒れるか!' : '広い!'
}
その子何したんだろうね?.('殺人')
#=> アホか!むしろ怒れるか!
その子何したんだろうね?.('北海道')
#=> 広い!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment