Glossary

accessor

A method for accessing data in a class that is usually inaccessible otherwise. Also called getter and setter methods—def a;@a;end and def b=(val);@b=val;end are examples of a getter and setter, respectively. The Module#attr, Module#attr_accessor, Module#attr_reader, and Module#attr_writer metaprogramming methods also define accessors.

aliasing

Using the Ruby keyword alias or Module#alias_method, you can alias a method by specifying a new and old name.

ARGF

An I/O-like stream that allows access to a virtual concatenation of all files provided on the command line, or standard input if no files are provided.

ARGV

An array that contains all of the command-line arguments passed to a program.

argument

The value of a parameter, passed to a method. With the method hello ( name ), in the call hello ( "Matz" ), the value "Matz" is the argument. See also method.

array

A data structure containing an ordered list of elements—which can be composed of any Ruby object—starting with an index of 0. See also hash.

ASCII

Abbreviation for American Standard Code for Information Interchange. ASCII is a character set representing 128 letters, numbers, symbols, and special codes, in the range 0–127. Each character can be represented by an 8-bit byte (octet). One of many possible character sets (encodings) now available in Ruby. See also UTF-8.

block

A nameless function, always associated with a method call, contained in a pair of braces ({}) or do/end.

block comment ...

Get Ruby Pocket Reference, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.