Ruby Quick Syntax Reference

Book description

Ruby Quick Syntax Reference is a condensed code and syntax reference to the Ruby scripting language. It presents the essential Ruby syntax in a well-organized format that can be used as a handy reference.

You won't find any technical jargon, bloated samples, drawn out history lessons, or witty stories in this book. What you will find is a language reference that is concise, to the point and highly accessible. The book is packed with useful information and is a must-have for any Ruby programmer.

In Ruby Quick Syntax Reference, you will find:

  • A concise reference to the Ruby language syntax.
  • Short, simple, and focused code examples.
  • A well laid out table of contents and a comprehensive index, allowing easy review.
  • Table of contents

    1. Cover
    2. Title
    3. Copyright
    4. Dedication
    5. Contents at a Glance
    6. Contents
    7. About the Author
    8. About the Technical Reviewer
    9. Acknowledgments
    10. Introduction
    11. Chapter 1: Introducing Ruby
      1. Installing Ruby
        1. Installing on Linux or Mac OS X
        2. Installing on Windows
      2. A Quick Tour
        1. irb: The Interactive Ruby Shell
        2. Object-Oriented
        3. Blocks and Iterators
        4. Modules
        5. Duck Typing
      3. Where to Find Ruby Documentation
        1. RDoc and ri
    12. Chapter 2: Operators
      1. Expressions
      2. Operators
        1. Arithmetic: + - * / %
        2. Shift or Append: << >>
        3. Comparison: < <= > >= <=>
        4. Booleans: & || ! and or not
        5. Ranges: .. …
    13. Chapter 3: Strings
      1. String Literals
      2. String Methods
      3. Concatenating Strings
      4. Repeating Strings
      5. Extracting Strings
      6. Utilizing Strings
    14. Chapter 4: Arrays
      1. Creating Arrays
      2. Accessing Array Elements
      3. Accessing Array Elements (Part 2)
      4. Adding/Removing Items from an Array
      5. Looping Through Arrays
      6. Selecting Elements from an Array
      7. Exercise
    15. Chapter 5: Hashes
      1. Creating Hashes
      2. Hash Information
      3. Sorting Hash Elements
      4. Accessing Hash Elements
      5. Looping Through Hashes
      6. Altering Hashes
      7. Merging Hashes
      8. Exercise
    16. Chapter 6: Numbers
      1. Creating Numbers
      2. Numeric Alterations
      3. Numeric Comparisons
      4. Exercise
    17. Chapter 7: Booleans
      1. Creating Boolean Values
      2. Expression Tests
      3. Comparative Operators
    18. Chapter 8: Objects
      1. Constants
        1. ARGF
        2. ARGV
        3. DATA
        4. ENV
        5. RUBY_*
        6. STDERR
        7. STDIN
        8. STDOUT
        9. TOPLEVEL_BINDING
        10. TRUE/FALSE/NIL
      2. Comparisons
      3. Duplication of Objects
      4. Freezing of Objects
      5. Object Metadata
    19. Chapter 9: Loops and Iterators
      1. Loop Method
      2. While Loop
      3. Until Loop
      4. While and Until Loops – Alternative Syntax
      5. For Loop
      6. Each Iterator
      7. The Times Iterator
      8. Upto and Step Iterators
      9. Each_Index Iterator
      10. Exercise
    20. Chapter 10: Functions and Methods
      1. Defining and Calling Methods
      2. Default Parameters
      3. Initialize Method
      4. Returns
      5. Returning Multiple Values
      6. Complex Methods
      7. Named and Variable Parameters
      8. Aliasing a Method
      9. Un-defining a Method
      10. Class Methods versus Instance Methods
      11. Exercise
    21. Chapter 11: Classes and Modules
      1. Properties
      2. Constructors
      3. Private Methods
      4. Protected Methods
      5. Modules
      6. Ruby Class Variables
        1. Local Variables
        2. Instance Variables
        3. Class Variable
        4. Global Variable
    22. Chapter 12: Blocks, Procs, and Lambdas
      1. Blocks
      2. Yield
      3. Procs
      4. Lambdas
    23. Chapter 13: Errors and Exceptions
      1. Errors
        1. Catching Errors and Exceptions
        2. Raising Exceptions
        3. Creating Our Own Exceptions
        4. Ensure
        5. Throw/Catch
    24. Chapter 14: Input/Output
      1. File Input/Output
      2. Seek Types
      3. File Modes
      4. Network Input/Output
      5. Higher Level Network Input/Output
    25. Chapter 15: Files and Directories
      1. Directory Modification
      2. File Access
      3. File Modification
    26. Chapter 16: Metaprogramming
      1. Classes
      2. Method Calls
    27. Index

    Product information

    • Title: Ruby Quick Syntax Reference
    • Author(s):
    • Release date: December 2014
    • Publisher(s): Apress
    • ISBN: 9781430265696