tailieunhanh - Ruby for Rails phần 6
Một danh sách các lỗi thường gặp ("gotchas") có thể tra trong cuốn sách của Hal Fulton The Ruby Way, trang 48–64. Tuy nhiên, vì danh sách trong cuốn sách là dựa trên phiên bản cũ của Ruby (version ), một số mục đã được sửa đổi sau khi cuốn sách ấn hành. Ví dụ, retry bây giờ làm việc được với while, until và for, cũng như với iterators. | Part 3 Built-in classes and modules I n part. 3 we ll look in detail at a number of the built-in classes and modules that are part of the Ruby language. Some of them strings and integers for example you ve seen before at least briefly or in a usage context. Here we ll go into depth about each of the classes and modules we look at and you ll learn how to use several instance and or class methods from each one. The material presented here represents a selection of classes and modules and a selection of the methods of those classes and modules. The selection is weighted toward those that are more rather than less likely to be of use to Rails developers. However what s really of use to Rails developers is a grasp of the Ruby language as a system and a reasonably general Ruby literacy. A dual principle has guided the content of these chapters not casting such a wide net that the Rails orientation gets diluted out of existence but also not scrubbing Ruby clean of its integral organic systemic qualities. Chapter 9 covers some preliminaries that will help you get your bearings in the subsequent chapters. It pulls together aspects that a lot of objects have in common so those points don t have to be covered repeatedly or confined to one chapter when they really apply to all. From chapter 10 on we ll discuss specific classes and modules. Chapter 10 deals with scalar objects one-dimensional objects like strings and numbers. Chapter 11 covers Ruby s built-in collection classes Array and Hash. In the course of these two chapters you ll also learn about the Comparable and Enumerable modules which are the source of searching filtering and sorting capabilities for many Ruby classes and which you can mix into your own classes . Chapter 12 discusses regular expressions and with that material in place circles back to discuss string- and array-related methods that use regular expressions as arguments. Finally Chapter 13 introduces you to dynamic Ruby an umbrella term for a number of .
đang nạp các trang xem trước