Chapter 7. Working with Times and Dates


6.3. Conclusion

In this chapter we've seen what symbols are in Ruby and how they are used. We've seen both standard and user-defined uses of symbols.

We've also looked at ranges in depth. We've seen how to convert them to arrays, how to use them as array or string indices, how to iterate over them, and other such operations. We've looked in detail at the flip-flop operator (and an alternative to the old syntax). Finally we've seen in detail how to construct a class so that it works well with range operators.

That ends our discussion of symbols and ranges. But as they are commonly used in Ruby (and are extremely useful), you'll see more of them both in incidental code throughout the rest of the book.




The Ruby Way(c) Solutions and Techniques in Ruby Programming
The Ruby Way, Second Edition: Solutions and Techniques in Ruby Programming (2nd Edition)
ISBN: 0672328844
EAN: 2147483647
Year: 2004
Pages: 269
Authors: Hal Fulton

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net