Ruby Pocket Reference: Instant Help for Ruby Programmers

Ruby Pocket Reference: Instant Help for Ruby Programmers

by Michael Fitzgerald
Ruby Pocket Reference: Instant Help for Ruby Programmers

Ruby Pocket Reference: Instant Help for Ruby Programmers

by Michael Fitzgerald

eBook

$10.99  $12.99 Save 15% Current price is $10.99, Original price is $12.99. You Save 15%.

Available on Compatible NOOK devices, the free NOOK App and in My Digital Library.
WANT A NOOK?  Explore Now

Related collections and offers


Overview

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: 9781491925973
Publisher: O'Reilly Media, Incorporated
Publication date: 08/10/2015
Sold by: Barnes & Noble
Format: eBook
Pages: 224
File size: 2 MB

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
From the B&N Reads Blog

Customer Reviews