Ruby Pocket Reference

Ruby Pocket Reference

by Michael Fitzgerald

Paperback(2nd ed.)

$13.49 $14.99 Save 10% Current price is $13.49, Original price is $14.99. You Save 10%.
View All Available Formats & Editions
Choose Expedited Shipping at checkout for guaranteed delivery by Thursday, November 21


Updated for Ruby 2.2, this handy reference offers brief yet clear explanations of Ruby’s core elements—from operators to blocks to documentation creation—and highlights the key features you may work with every day. Need to know the correct syntax for a conditional? Forgot the name of that String method? This book is organized to help you find the facts fast.

Ruby Pocket Reference, 2nd Edition is ideal for experienced programmers who are new to Ruby. Whether you’ve come to Ruby because of Rails, or you want to take advantage of this clean, powerful, and expressive language for other applications, this reference will help you easily pinpoint the information you need.

You’ll find detailed reference material for:

  • Keywords, operators, comments, numbers, and symbols
  • Variables, pre-defined global variables, and regular expressions
  • Conditional statements, method use, classes, and exception handling
  • Methods for the BasicObject, Object, Kernel, String, Array, and Hash classes
  • Time formatting directives
  • New syntax since Ruby 1.9

Product Details

ISBN-13: 9781491926017
Publisher: O'Reilly Media, Incorporated
Publication date: 08/29/2015
Edition description: 2nd ed.
Pages: 224
Sales rank: 734,035
Product dimensions: 4.20(w) x 6.90(h) x 0.50(d)

About the Author

Michael Fitzgerald is an author, coder, and novelist who has written over 20 books. He is the author of O’Reilly’s Learning Ruby , Learning XSLT , and XML Hacks , and co-author on the XML Pocket Reference.

Table of Contents

Running Ruby     2
Running the Ruby Interpreter     3
Using a Shebang Line on Unix/Linux     5
Associating File Types on Windows     5
Reserved Words     7
Operators     9
Comments     10
Numbers     11
Variables     11
Local Variables     12
Instance Variables     12
Class Variables     13
Global Variables     13
Constants     13
Parallel Assignment of Variables     13
Symbols     14
Predefined Variables     14
Pseudovariables     17
Global Constants     18
Ranges     19
Methods     19
Parentheses     20
Return Values     20
Method Name Conventions     21
Default Arguments     22
Variable Arguments     22
Aliasing Methods     23
Blocks     23
Procs     25
Conditional Statements     27
The if Statement     27
The unless Statement     29
The while Statement     30
The untilStatement     31
The case Statement     32
The for Loop     33
The Ternary Operator     34
Executing Code Before or After a Program     34
Classes     34
Instance Variables     36
Accessors     38
Class Variables     39
Class Methods     40
Singletons     40
Inheritance     42
Public, Private, or Protected     42
Modules and Mixins     44
Files     47
Creating a New File     47
Opening an Existing File     48
ARGV and ARGF     48
Renaming and Deleting Files     49
File Inguiries     50
File Modes and Ownership     51
The 10 Class     52
Exception Handling     54
The rescue and ensure Clauses     55
The raise Method     55
The catch and throw Methods     56
Object Class     56
Object Instance Methods     57
Kernel Module     62
String Class     72
Expression Substitution     73
General Delimited Strings     73
Here Documents     73
Escape Characters     75
Character Encoding     75
Regular Expressions     76
String Methods     81
Array Class     94
Creating Arrays     94
Array Class Methods     96
Array Instance Methods     96
Hash Class     106
Creating Hashes     107
Hash Class Methods     108
Hash Instance Methods     108
Time Formatting Directives     113
Interactive Ruby (irb)     114
Ruby Debugger     117
Ruby Documentation     119
RDoc Options     121
RubyGems     125
Rake     131
Ruby Resources     133
Glossary     134
Index     151

Customer Reviews

Most Helpful Customer Reviews

See All Customer Reviews

Ruby Pocket Reference 5 out of 5 based on 0 ratings. 1 reviews.
Anonymous More than 1 year ago