Learning Ruby
You don't have to know everything about a car to drive one, and you don't need to know everything about Ruby to start programming with it. Written for both experienced and new programmers alike, Learning Ruby is a just-get-in-and-drive book -- a hands-on tutorial that offers lots of Ruby...
Autor principal: | |
---|---|
Formato: | Libro electrónico |
Idioma: | Inglés |
Publicado: |
Sebastopol, California :
O'Reilly
2007.
|
Edición: | First edition |
Materias: | |
Ver en Biblioteca Universitat Ramon Llull: | https://discovery.url.edu/permalink/34CSUC_URL/1im36ta/alma991009627055906719 |
Tabla de Contenidos:
- Learning Ruby; How This Book Works; About the Examples; How This Book Is Organized; Conventions Used in This Book; Comments and Questions; Safari® Enabled; Acknowledgments; 1. Ruby Basics; Shebang!; Issue a System Command; Appending a String; Multiply; Inserting a Shell Command; Using a Variable; Expression Substitution; Formatting a String; The eval Method and -e Option; Getting Input from the Keyboard; Methods; The block; The each Method; The proc; XML; The Class; The Tk Toolkit; Editing and Running Ruby in TextMate; Interactive Ruby; Resources; Installing Ruby
- Installing Ruby on Windows with the One-Click InstallerInstalling Ruby on Windows with Binaries; Installing Ruby on Linux; Permission Denied; Associating File Types on Windows; Review Questions; 2. A Quick Tour of Ruby; Ruby&s Reserved Words; Comments; Variables; Instance Variables; Class Variables; Global Variables; Constants; Parallel Assignment; Strings; Numbers and Operators; Conditional Statements; Arrays and Hashes; Methods; Method Name Conventions; Default Arguments; Variable Arguments; Aliasing Methods; Blocks; Procs; Symbols; Exception Handling; Ruby Documentation; Review Questions
- 3. Conditional LoveThe Ternary Operator; The case Statement; The while Loop; unless and until; The loop Method; The for loop; The upto Method; The downto Method; Execution Before or After a Program; Review Questions; 4. Strings; Here Documents; Concatenating Strings; Accessing Strings; Comparing Strings; Manipulating Strings; Changing All or Part of a String; The chomp and chop Methods; The delete Method; Substitute the Substring; Turn It Around; From a String to an Array; Case Conversion; downcase, upcase, and swapcase; Managing Whitespace, etc.; Incrementing Strings; Converting Strings
- Regular Expressions1.9 and Beyond; Review Questions; 5. Math; Converting Numbers; Basic Math Operations; Equality, Less Than, or Greater Than; Abbreviated Assignment Operators; Operators; Ranges; Inquiring About Numbers; More Math Methods; Math Functions; Rational Numbers; Prime Numbers; Review Questions; 6. Arrays; Creating an Array with a Block; There&s an Easier Way; It Gets Even Easier; Accessing Elements; Concatenation; Set Operations; Unique Elements; Blow Your Stack; Comparing Arrays; Changing Elements; Using shift and unshift; Deleting Elements; Arrays and Blocks
- Sorting Things and About FaceMultidimensional Arrays; 1.9 and Beyond; Other Array Methods; Review Questions; 7. Hashes; Accessing Hashes; Iterating over Hashes; Changing Hashes; Sorting a Hash; Deleting and Clearing a Hash; Replacing a Hash; Converting Hashes to Other Classes; 1.9 and Beyond; Other Hash Methods; Review Questions; 8. Working with Files; The Directory Stream; Creating a New File; Opening an Existing File; Opening a URI; Deleting and Renaming Files; File Inquiries; Changing File Modes and Owner; The IO Class; Review Questions; 9. Classes; Instance Variables; Accessors
- Class Variables