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

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
主站蜘蛛池模板: 江城| 新竹市| 桂东县| 贵港市| 新乡县| 临洮县| 屏南县| 长海县| 安龙县| 镇巴县| 绥阳县| 河东区| 长岛县| 汕尾市| 石阡县| 南靖县| 平顺县| 江孜县| 澄江县| 阿荣旗| 西昌市| 泽州县| 新宁县| 磴口县| 青龙| 常熟市| 上思县| 棋牌| 马鞍山市| 永宁县| 耒阳市| 古交市| 霍林郭勒市| 鹤峰县| 龙门县| 潞西市| 甘德县| 神农架林区| 禄丰县| 香格里拉县| 长顺县|