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

Summary

In this chapter, we took a journey into data types and some very common operations that can be performed on them. We started out with array operations and took a closer look at adding, removing, and iterating over this data type. Then, we moved on to the hash data type and discovered the hidden magic that powers most of the web and desktop applications written in Ruby. Hashes are a very common way to store and manipulate data inside web applications. We added, removed, and iterated over hashes, and then performed some symbol-based sorting with nested hashes. Our final destination in this chapter was the methods and functions that allow us to create either functional or procedural applications in Ruby. Functions and methods in themselves are not of much use, so we imbued them with arguments. We also took a closer look at how optional and default arguments are handled in case multiple arguments are passed. This constituted a very important chapter, namely, how the extra arguments are mapped to the predefined arguments. In the next chapter, we will be studying methods in detail and how they define the program workflows.

主站蜘蛛池模板: 玉屏| 渑池县| 龙陵县| 大理市| 德格县| 若尔盖县| 定南县| 类乌齐县| 长子县| 伊宁市| 新邵县| 治县。| 甘南县| 措勤县| 铁力市| 潼南县| 洛川县| 临清市| 灵寿县| 隆尧县| 安平县| 旅游| 横山县| 濮阳县| 罗源县| 武冈市| 鹤庆县| 秦皇岛市| 潮州市| 千阳县| 儋州市| 青铜峡市| 河南省| 桂东县| 剑河县| 永登县| 阿克| 枣强县| 吉林市| 桃江县| 龙陵县|