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

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
主站蜘蛛池模板: 稷山县| 华坪县| 阳山县| 杨浦区| 依安县| 保定市| 瑞丽市| 东阿县| 新河县| 滨州市| 红原县| 九台市| 喜德县| 鄢陵县| 桦甸市| 宜州市| 巴林右旗| 宝兴县| 罗江县| 和龙市| 绿春县| 陵水| 永康市| 泗水县| 永新县| 偃师市| 景洪市| 宜良县| 綦江县| 阿瓦提县| 天祝| 三江| 保亭| 昌乐县| 密山市| 哈尔滨市| 建瓯市| 江山市| 久治县| 合江县| 宿松县|