官术网_书友最值得收藏!

Ruby Methods

One of the most powerful tools available to developers is the ability to store functionality and share that behavior throughout a program. In this chapter, you'll learn how to create and use methods in Ruby programs to store processes and reuse them throughout a program, including an overview of procs and lambdas. Additionally, we'll walk through how you can do the following:

  • Demonstrate how to build methods in Ruby to encapsulate various processes
  • Develop proc- and lambda-based programs and show when to use closures instead of traditional methods
  • Recommend how to work with the full list of method argument options, including traditional, splat, named, and default arguments
主站蜘蛛池模板: 新平| 额尔古纳市| 衡南县| 玉环县| 杂多县| 柳州市| 格尔木市| 龙游县| 利津县| 陇川县| 栾城县| 福清市| 通许县| 含山县| 沅陵县| 临高县| 新兴县| 得荣县| 星座| 辽中县| 兖州市| 江门市| 永修县| 上杭县| 图木舒克市| 丰原市| 马公市| 永平县| 永清县| 桃园市| 钦州市| 黄浦区| 阜城县| 永平县| 双鸭山市| 含山县| 贺兰县| 老河口市| 沁阳市| 隆德县| 杭锦后旗|