红宝石花招

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了红宝石花招相关的知识,希望对你有一定的参考价值。

Following a
  1. print <<EOF
  2. The price is #{$Price}.
  3. EOF
  4.  
  5. print <<"EOF"; # same as above
  6. The price is #{$Price}.
  7. EOF
  8.  
  9. print <<`EOC` # execute commands
  10. echo hi there
  11. echo lo there
  12. EOC
  13.  
  14. print <<"foo", <<"bar" # you can stack them
  15. I said foo.
  16. foo
  17. I said bar.
  18. bar
  19.  
  20. myfunc(<<"THIS", 23, <<'THAT')
  21. Here's a line
  22. or two.
  23. THIS
  24. and here's another.
  25. THAT
  26.  
  27. if need_define_foo
  28. eval <<-EOS # delimiters can be indented
  29. def foo
  30. print "foo "
  31. end
  32. EOS
  33. end

以上是关于红宝石花招的主要内容,如果未能解决你的问题,请参考以下文章

棘手的算术还是花招?

芯片设计“花招”已耍完?无指令集架构颠覆旧套路

在中欧重压下,苹果将采用Type-C接口,不过贪婪的它玩了小花招

VIM 花招:格式化 gdb 打印的长变量输出

小花招解决Android 9 Pie 不能反射隐藏API限制

AI 测试又多新花招? ai-webdriver-1.0.1 独家更新