Elephant
oreilly.com O'Reilly Network Safari Bookshelf Conferences Sign In/My Account | View Cart   
Book List Learning Lab eDocuments O'Reilly Gear Newsletters Press Room Jobs      O'Reilly China O'Reilly France O'Reilly Germany O'Reilly Japan O'Reilly Taiwan O'Reilly UK 

Free shipping on all orders of $29.95 and above
Ruby in a Nutshell
see larger cover

Ruby in a Nutshell

By Yukihiro Matsumoto
Translated by David L. Reynolds, Jr.
First Edition November 2001 
Series: In a Nutshell
ISBN: 0-596-00214-9
218 pages, $24.95 US, $37.95 CA, £17.50 UK
Add to Cart Add to UK Cart Read Online--Safari

Index


[ Symbols ], 
[ A ], 
[ B ], 
[ C ], 
[ D ], 
[ E ], 
[ F ], 
[ G ], 
[ H ], 
[ I ], 
[ J ], 
[ K ], 
[ L ], 
[ M ], 
[ N ], 
[ O ], 
[ P ], 
[ Q ], 
[ R ], 
[ S ], 
[ T ], 
[ U ], 
[ V ], 
[ W ], 
[ X ], 
[ Y ], 
[ Z ]

Symbols[ Top ]
<=>
      Comparable module, 73
      Date instance method, 162
      File::Stat instance method, 83
      Module instance method, 96
      Time instance method, 107
& (ampersand)
      Array instance method, 59
      FalseClass instance method, 103
      HTML special character, 130
      Integer instance method, 71
      logical operators, 19
      TrueClass instance method, 103
* (asterisk)
      $* variable, 38
      Array instance method, 59
      as control character, 13
      directives and, 63
      Matrix instance method, 156
      Numeric instance method, 69
      parallel assignments and, 17
      Rational class and, 154
      String class methods and, 50
@ (at sign)
      instance variables and, 15
      $@ variable, 36
\ (backslash)
      at end of line, 8
      control characters and, 13
      predefined variable, 36
      strings and, 10
      while statement and, 26
{} (braces)
      as control character, 13
      as string delimiter, 11
      local variables and, 15
[] (brackets)
      array expressions and, 12
      as control characters, 13
^ (caret)
      as control character, 13
      FalseClass instance method, 104
      Integer instance method, 71
      TrueClass instance method, 103
: (colon)
      separating paths with, 7
, (comma), 36
$ (dollar sign)
      as control character, 13
      global variables and, 15
      predefined variable, 37
= (equal sign)
      abbreviated assignments and, 17
      accessor methods and, 32
      case statement and, 26
      Comparable instance method, 74
      Module instance method, 96
      Range instance method, 104
      Regexp instance method, 57
      String class methods and, 50
! (exclamation point)
      appending to methods, 20
      Array class methods, 59
      Hash class and, 65
      String class methods and, 50
      string delimiter, 11
> (greater than sign)
      Comparable instance method, 74
      HTML special character, 130
      Module instance method, 96
      predefined variable, 36
      Time instance method, 107
>> (greater than signs)
      Date instance method, 162
      Integer instance method, 71
< (less than sign)
      as string delimiter, 11
      Comparable instance method, 74
      HTML special character, 130
      Module instance method, 96
      Time instance method, 107
<< (less than sign)
      abbreviated assignments and, 17
<< (less than signs)
      Array instance method, 60
      Curses::Window class and, 138
      Date instance method, 162
      Integer instance method, 71
      IO instance method, 76
      MD5 instance method, 165
      SHA1 instance method, 165
      String class methods and, 50
- (minus sign)
      Array instance method, 59
      at end of line, 8
      Date instance method, 162
      Matrix instance method, 156
      Numeric instance method, 69
      Time instance method, 107
( ) (parentheses)
      as control characters, 13
      as string delimiter, 11
% (percent)
      as conversion specifier, 44
      directives and, 108
      Numeric instance method, 69
      String class methods and, 50
      wildcard patterns, 123
. (period)
      as control character, 13
      IO instance method, 76
      predefined variable, 36
+ (plus sign)
      Array instance method, 59
      as control character, 13
      at end of line, 8
      Date instance method, 162
      Matrix instance method, 156
      Numeric instance method, 69
      predefined variable, 38
      String class methods and, 50
      Time instance method, 107
# (pound sign)
      comment and, 14
      comments and, 8
      expression substitution, 10
? (question mark)
      appending to methods, 20
      as control character, 13
      predefined variable, 37
      ternary operator, 19
      test( ) function and, 45
" (quotation marks)
      as empty strings, 146
      delimited strings and, 11
      predefined variables, 38
      strings and, 10
; (semicolon)
      begin statement and, 28
      case statement and, 26
      for statement and, 27
      if statement and, 25
      interpretation of, 8
      separating paths with, 7
      until statement and, 26
      while statement and, 26
~ (tilde)
      expanding, 7
      Integer instance method, 71
      local variable, 37
      Regexp instance method, 57
      String class methods and, 50
_ (underscore), 9, 15
      $_ variable, 37, 40, 41, 42, 45
| (vertical bar)
      abbreviated assignments and, 17
      Array instance method, 59
      as control character, 13
      FalseClass instance method, 103
      Integer instance method, 71
      open( ) function and, 42
      TrueClass instance method, 103
/ (slash)
      Matrix instance method, 156
      Numeric instance method, 69
      predefined variable, 36
      regular expressions and, 12

A[ Top ]
-a option, 5, 37
abort
      Kernel, 39
      Net::FTP, 118
      PStore, 153
      security level 4 and, 35
abort_on_exception (Thread), 91, 92
abs
      Complex, 154
      Numeric, 69
abs2 (Complex), 154
accept
      Socket, 117
      UNIXServer, 116
accessors
      CGI class, 134
      CGI::Cookie class, 134
      methods, 32
acct (Net::FTP), 118
add
      IPSocket, 112
      ThreadGroup, 93
add_authenticator (Net::IMAP), 122
addch (Curses), 136, 138
add_observer (Observable), 160
addr
      Socket, 117
      UNIXSocket, 115
addstr (Curses), 137, 138
alias statement, 23
alias_method (Module), 97
alive? (Thread), 92
all (Net::POPMail), 126
all_waits (ThreadsWait), 151
ancestors (Module), 96
append (Net::IMAP), 122
append_features (Module), 97
arc tangent, atan2( ) and, 74
arg (Complex), 154
ARGF constant, 36, 37, 38
ArgumentError class, 94
arguments
      accessor methods and, 32
      calls method and, 20
      def statement, 22
      GetoptLong class and, 143, 145
      interpreting, 6
      new method and, 32
ARGV constant, 33, 38
arity
      Method, 101
      Proc, 100
Array class, 59-64
Array function, 39
arrays
      as container classes, 12
      def statement arguments and, 22
      delimited string, 12
      select( ) function and, 43
      to_a and, 49, 59
      unpack( ), 55
      (see also specific methods for Array class)
ASCII
      Ruby support for, 178
      specifying, 6
asctime (Time), 107
assignments, 16-17
assoc (Array), 60
at
      Array, 60
      Time, 106
atan2 (Math), 74
at_exit (Kernel), 39
atime (File), 79, 82, 83
attr, 97
attr (Module), 97
attr_accessor (Module), 97
attributes
      as variables, 32
      assignments and, 17
      CGI class, 134
      Struct class and, 105
      tags common to HTML, 133
attr_reader (Module), 97
attr_writer (Module), 98
authenticate (Net::IMAP), 122
authentication
      Net::APOP class and, 125
      Net::IMAP class and, 122
autoload (Kernel), 35, 39

B[ Top ]
b (conversion specifier), 44
backslash notation, 10, 52
backspace, 14
backtrace (Exception), 93
--back-trace-limit option (irb), 172
basename (File), 79
BasicSocket class, 111, 112, 115
beep (Curses), 137
=begin, embedded documents and, 8
begin
      MatchData, 58
      Range, 104
begin statement, 28, 29
begx (Curses::Window), 138
begy (Curses::Window), 138
between? (Comparable), 74
Bignum class, 9, 72
binary integers, conversion specifiers and, 44
bind
      Socket, 117
      UDPSocket, 113
      UnboundMethod, 101
binding function, 39, 101
binmode (Net::Telnet), 128
blksize (File::Stat), 83
blockdev? (File), 79, 83, 86
block_given? (Kernel), 39
blocks
      begin statement and, 28
      block_given? function and, 39
      each_line( ) and, 52
      initializing, 32
      variable scope in, 21
blocks (File::Stat), 84
box (Curses::Window), 139
break statement, 27
broadcast (ConditionVariable), 148

C[ Top ]
-C option, 5
-c option, 5
c (conversion specifier), 44
calendars, Julian and Gregorian, 161
call
      Continuation, 102
      Method, 101
      Proc, 100
      redo statement and, 27
      Win32API, 147
callcc (Kernel), 39
caller (Kernel), 39
capability (Net::IMAP), 122
capitalize (String), 51
capitalize! (String), 51
case statements, 26, 57
casefold? (Regexp), 57
catch (Kernel), 39, 46
cbreak (Curses), 137
ceil (Numeric), 69
center (String), 51
CGI class, 129-132, 134
CGI (Common Gateway Interface), 34, 129
CGI::Cookie class, 131, 134
CGI::Session class, 135, 136
changed (Observable), 160
changed? (Observable), 160
characters
      control, 13
      conversion specifiers and, 44
      deleting, 137
      deleting from string, 51, 52
      HTML special, 130
      outputting to screen, 136
      reading screen, 137
      replacing in string, 55
      reversing in string, 53
      upper and lowercase, 9
chardev?
      File, 79
      File::Stat, 84
      FileTest, 86
chdir
      Dir, 34, 87
      Net::FTP, 118
check (Net::IMAP), 122
checkbox (CGI), 131
checkbox_group (CGI), 131
checksum, sum( ) and, 55
chmod (File), 34, 79, 142
chmode (File), 82
chomp
      Kernel, 40
      String, 51
chomp!
      Kernel, 40
      String, 51
chop
      Kernel, 40
      String, 51
chop!,
      Kernel, 40
      String, 51
chown (File), 34, 79, 82
chr (Integer), 71
chroot (Dir), 34, 87
Class class, 29, 30, 99
class (Kernel), 48
class statement, 21, 30
class variables, 15
class_eval (Class), 99
class_variables (Module), 96
clear
      Array, 60
      Curses, 137
      Curses::Window, 139
      Hash, 65
clone
      Kernel, 48
      MD5, 164
      SHA1, 165
close
      Curses::Window, 139
      database manager, 136
      DBM, 152
      Dir, 88
      IO, 76
      Net::FTP, 118
      Net::IMAP, 122
      Tempfile, 147
closed?
      IO, 76
      Net::FTP, 118
close_read (IO), 76
close_screen (Curses), 137
close_write (IO), 76
cmd (Net::Telnet), 128
cmp (File), 142
coerce (Numeric), 69
collect! (Array), 60
collect
      Array, 60
      Enumerable, 67
      Matrix, 156
cols (Curses), 137
column (Matrix), 156
columns (Matrix), 155
column_size (Matrix), 156
column_vector (Matrix), 155
column_vectors (Matrix), 156
command-line options, 5-6, 143, 166
commands
      cmd( ) and, 128
      debugger, 166-168
      exec( ) function and, 40
      File::open( ) and, 80
      NOOP command, 123
      open( ) function and, 42
      system( ) function and, 45
      trap( ) function and, 46
      untrace_var( ) function and, 46
comments, 8, 14
commit (PStore), 153
compact (Array), 60
compact! (Array), 60
Comparable module
      built-in library, 73
      File::Stat object and, 83
      included in Date class, 161
      Numeric class and, 69
      String class and, 50
      Time class and, 106
compare (File), 142
compile (Regexp), 57
completion_append_character (Readline), 146
completion_case_fold (Readline), 146
completion_proc (Readline), 146
Complex class, 154
COMSPEC, spawned processes and, 8
concat
      Array, 60
      String, 51
concatenation, 10, 50
conditional statements, 18, 25-27
ConditionVariable class, 148
conjugate (Complex), 154
connect
      Net::FTP instance method, 118
      Socket instance method, 117
      UDPSocket instance method, 113
constants
      assignments and, 16
      built-in library, 75
      classes and, 30
      Date class, 163
      Fcntl module and, 141
      File class, 82
      GetoptLong class, 144
      identifiers as, 9
      predefined global, 38
      Process module and, 90
      pseudo-variables and, 16
      Readline module, 146
      Socket class, 117
      ThreadGroup class and, 93
      uppercase letter, 16
constants (Module), 96
const_defined? (Module), 96
const_get (Module), 96
const_set (Module), 96
Continuation class, 102
control structures, 25-29
conversion specifiers, 44
cookies (CGI), 131
copy
      File, 142
      Net::IMAP, 122
--copyright option, 6
cos (Math), 74
count (String), 51
count_observers (Observable), 160
cp (File), 142
create (Net::IMAP), 122
critical (Thread), 91
crmode (Curses), 137
crypt (String), 51
ctime
      File, 79, 82
      File::Stat, 84
      Time, 107
current (Thread), 91
Curses module, 136
Curses::Window class, 138-139
cursors, manipulating, 138
curx (Curses::Window), 139
cury (Curses::Window), 139
CVS (Concurrent Version System) web site, 176
cwday (Date), 162
cweek (Date), 162
cwyear (Date), 162

D[ Top ]
-d option, 5, 37, 171
d (conversion specifier), 44
DATA constant, 38
data persistence, 151
data retrieval, 140
data wrapper, 104
database manager, 136
databases, 152, 174
Date class, 161-163
date formatting, 130
day
      Date, 162
      Time, 107
DAYNAMES constant, 163
DBM class, 152
$DEBUG (predefined variable), 5, 37, 171
debug mode
      enabling parser, 6
      returning status, 118
      setting, 5
debug (Net::IMAP), 122
--debug option, 6, 37
debugger, 166-169
debugging
      p( ) function and, 42
      Ruby bug database, 176
      set_trace_func( ) function, 43
debug_mode (Net::FTP), 118
decimals, 44, 63
def statement
      arguments for, 22
      class methods and, 30
      local variables and, 21
      singleton methods and, 22
Default (constant), 93
default (Hash), 65
def_delegator
      Forwardable, 159
      SingleForwardable, 159
def_delegators
      Forwardable, 159
      SingleForwardable, 159
defined?
      operator, 19
define_finalizer (ObjectSpace), 102
def_instance_delegator (Forwardable), 159
def_instance_delegators (Forwardable), 159
$defout
      predefined variable, 36, 37
      printf( ) function and, 42
      putc( ) function and, 42
      puts( ) function and, 43
def_singleton_delegator (SingleForwardable), 159
def_singleton_delegators (SingleForwardable), 159
delch
      Curses, 137
      Curses::Window, 139
DelegateClass (DelegatorClass), 158
Delegator class, 158
DelegatorClass class, 158
delete
      Array, 60
      CGI::Session, 136
      database manager, 136
      Dir, 88
      File, 79
      Hash, 65
      Net::FTP, 119
      Net::IMAP, 122
      Net::POPMail, 126
      String c, 52
delete! (String), 52
delete_at (Array), 60
deleted? (Net::POPMail), 126
delete_if
      Array, 60
      Hash, 65
deleteln
      Curses, 137
      Curses::Window, 139
delete_observer (Observable), 160
delete_observers (Observable), 160
delimiters, 11, 12
design patterns, 158, 159
det (Matrix), 156
detect (Enumerable), 67
determinant (Matrix), 156
dev (File::Stat), 84
diagonal (Matrix), 155
digest
      MD5, 164
      SHA1, 165
Dir class, 34, 87-88
dir (Net::FTP), 119
directives
      decimals and, 63
      packing array elements, 62
      t.strftime( ) and, 108
directories
      changing, 5, 118
      creating, 119, 142
      data retrieval with Etc module, 140
      loading libraries, 5
      removing, 120
      security level 1 and, 34
      traversal of, 141
directory?
      File, 79
      File::Stat, 84
      FileTest, 86
dirname (File), 79
disable (GC), 102
disconnect (Net::IMAP), 123
display (Kernel), 48
divmod (Numeric), 70
DLN_LIBRARY_PATH (environment variable), 7
do (reserved word), 27
do_not_reverse_lookup (BasicSocket), 111
doupdate (Curses), 137
downcase (String), 52
downto
      Date, 162
      Integer, 71
dump
      Marshal, 104
      String, 52
dup (Kernel), 48
dynamic programming, 2

E[ Top ]
-e option, 5, 34
E (constant), 75
E (conversion specifier), 44
e (conversion specifier), 44
each
      Array, 60
      Dir, 88
      Enumerable, 67
      GetoptLong, 144
      Hash, 65
      IO, 76
      method example, 2
      Net::POP3, 125
      Range, 104
      String, 52
      Struct, 106
each_byte
      IO, 76
      String, 52
each_index (Array), 61
each_key (Hash), 65
each_line
      IO, 76
      String, 52
each_object (ObjectSpace), 103
each_option (GetoptLong), 144
each_pair (Hash), 65
each_value (Hash), 65
each_with_index (Enumerable), 67
echo (Curses), 137
editors, 146
egid (Process), 32, 34, 89
else clause, 22, 26, 28
Emacs editor, 146, 173
emacs_editing_mode (Readline), 146
empty?
      Array, 61
      Hash, 65
      Queue, 150
      String, 52
      ThreadsWait, 151
enable (GC method), 102
=end, embedded documents and, 8
end (MatchData), 58
end (Range), 105
end statement, 29, 39
ENGLAND constant, 163
enq (Queue), 150
ensure clause, 22, 26, 28
enter (Monitor), 148
entries
      Dir, 87
      Enumerable, 68
Enumerable module
      Array class and, 59
      built-in library, 67-69
      Dir class and, 87
      Hash class, 64
      included for DBM class, 152
      IO class and, 75
      String class and, 50
Enumerated module, 104
ENV constant, 38
ENV object, 7
environment variables, 7, 33, 35
eof (IO), 76
eof? (IO), 76
EOFError, 43, 94
eql? (Kernel), 48
equal? (Kernel), 48
Erb, eRuby implementation, 174
Errno::ENOENT class, 94, 95
Errno::EPERM class, 95
error (GetoptLong), 144
error? (GetoptLong), 144
error_message (GetoptLong), 144
eRuby (embedded Ruby), 174
eruby, original eRuby implementation, 174
escape
      CGI, 130
      Regexp, 57
escapeElement (CGI), 130
escapeHTML (CGI), 130
Etc module, 140
EUC (Extended Unix Code), 6
euid (Process), 89
eval, 34, 40
examine (Net::IMAP), 123
Exception class, 93-95
exception (Exception), 93
exception handling, 3, 28, 29, 93
exec( ) function, 40
executable?
      File, 79
      File::Stat, 84
      FileTest, 86
executable_real?
      File, 79
      File::Stat, 84
      FileTest, 86
exist?
      Date, 161
      File, 79
      FileTest, 86
exist2? (Date), 161
exist3? (Date), 161
existw? (Date), 161
exit
      Kernel, 40
      Monitor, 148
      security level 4 and, 35
      Thread, 91, 92
exit!
      Kernel, 40
      Process, 89
      security level 2 and, 34
exp (Math), 74
expand_path (File), 79
exponential function, 74
exponential notation, 44
expressions, 10, 12
expunge (Net::IMAP), 123
ext, as file extension, 5
extend
      adding properties with, 31
      Kernel, 48
extend_object (Module), 98
extensions, 5, 43

F[ Top ]
$F (predefined variable), 37
-F option, 5
-f option, 171
f (conversion specifier), 44
factorial function, 2
fail function, 40, 43
FALSE constant, 38
false (pseudo-variable), 16
FalseClass class, 103
Fatal class, 95
fcntl (IO), 76
Fcntl module, 141
fetch
      Hash, 65
      Net::IMAP, 123
_ _FILE_ _
      pseudo-variable, 16
File class, 34, 78, 142, 147
file?
      File, 79
      File::Stat, 84
      FileTest, 86
File::Constants module, 82
file_field (CGI), 131
$FILENAME (predefined variable), 37
fileno (IO), 76
files
      comparing, 142
      copying, 142, 143
      deleting, 119
      moving, 143
      removing, 143
      renaming, 120
      retrieving remote, 119
      test( ) function and, 45
      transferring, 119
      (see also Tempfile class)
File::Separator, 80
File::Stat object, 83-85
FileTest module, 34, 85
fill (Array), 61
find
      Enumerable, 68
      Find, 142
Find module, 142
find_all (Enumerable), 68
finish
      Net::HTTP, 121
      Net::POP3, 125
      Net::SMTP, 127
finished? (ThreadsWait), 151
finite? (Float), 73
first
      Array, 61
      Range, 104
Fixnum class, 9, 23, 29, 72
flags, conversion specifiers and, 44
flash (Curses), 137
flatten (Array), 61
flatten! (Array), 61
Float class, 9, 73
Float, 41, 55
FloatDomainError class, 94
floating point numbers
      conversion specifiers and, 44
      converting from integers, 72
      converting from string, 55
      Float( ) function and, 41
      rand( ) function and, 43
      support for, 9
flock (File), 82
floor (Numeric), 70
flush (IO), 76
-fname option, 173
for statement, 27
foreach
      Dir, 87
      IO, 75
for_fd (Socket), 116
fork
      Kernel, 41
      Process, 89
      security level 2 and, 34
      Thread, 91
form (CGI), 131
format function, 41, 44
--format option, 173
formatting date and time, 130
Forwardable module, 159
fractions, 74
freeze (Kernel), 48
frexp (Math), 74
frozen? (Kernel), 48
ftools library, 142
FTP (File Transfer Protocol), 118, 120
ftype
      File, 80
      File::Stat, 84
functions
      built-in, 39-46
      factorial, 2
      methods as, 20
      timeout procedure, 164

G[ Top ]
G (conversion specifier), 44
g (conversion specifier), 44
garbage collection, 3, 102, 146
garbage_collect
      (GC), 102
      (ObjectSpace), 103
GC module, 102
GDBM class, 152
get
      GetoptLong, 144
      Net::HTTP, 121
getaddress (IPSocket), 112
getaddrinfo (Socket), 116
getbinaryfile (Net::FTP), 119
getc (IO), 77
getch
      Curses, 137
      Curses::Window, 139
getdir (Net::FTP), 119
getgrgid (Etc), 140
getgrnam (Etc), 140
gethostbyaddr (Socket), 116
gethostbyname (Socket), 116
gethostname (Socket), 116
getlogin (Etc), 140
getnameinfo (Socket), 117
_ _getobj_ _ (Delegator), 157
get_option (GetoptLong), 144
GetoptLong class, 143-144
getpeername (BasicSocket), 111
getpgid (Process), 89
getpgrp (Process), 89
getpriority (Process), 89
getpty (PTY), 145
getpwnam (Etc), 140
getpwuid (Etc), 140
gets, 37, 41, 77
getservbyname (Socket), 117
getsockname (BasicSocket), 111
getsockopt (BasicSocket), 111
getstr
      Curses, 137
      Curses::Window, 139
gettextfile (Net::FTP), 119
getwd (Dir), 88
gid
      File::Stat, 84
      Process, 89
glob (Dir), 87
global variables, 15, 16, 46
global_variables (Kernel), 41
gm (Time), 106
gmt? (Time), 109
gmtime (Time), 107
gmtime? (Time), 107
GNU line editing library, 145, 152
greeting (Net::IMAP), 123
Gregorian calendar, 161
GREGORIAN constant, 163
grep (Enumerable), 68
group (Etc), 141
grpowned?
      File, 80
      File::Stat, 84
      FileTest, 86
gsub, 41, 52
gsub!, 41, 52

H[ Top ]
-h option, 5
Hash class, 64-67, 152
hashes
      CGI::Session class and, 135
      databases and, 152
      ENV as, 38
      eq?( ) method and, 48
      key-value pairs, 12
      method calls and, 20
has_key?
      CGI, 131
      Hash, 66
has_value? (Hash), 67
head (Net::HTTP), 121
header
      CGI, 131
      Net::POPMail, 126
help (Net::FTP), 119
--help option, 6
help options, 5, 6, 119
here documents, 11
hex (String), 52
hexadecimals, 44, 52
hexdigest
      MD5, 165
      SHA1, 165
hidden (CGI), 131
HIDDEN field, 131
HISTORY constant, 146
HOME (environment variable), 7
hooks, 32
hour (Time), 107
HTML (Hyper Text Markup Language)
      CGI class and, 129
      eRuby and, 174
      generation methods, 132
      new( ) and, 130
html3 tags, 133
html4 tags, 133
html4Fr tags, 133
html4Tr tags, 133
htmlFr tags, 133
HTTP (Hyper Text Transfer Protocol)
      CGI class and, 129
      CGI::Cookie class, 134
      CGI::Session class and, 135
      Net::HTTP class and, 120

I[ Top ]
-I option, 5, 34
-i option, 5, 14, 34
i (conversion specifier), 44
I (Matrix), 155
id (Kernel), 48
_id2ref (ObjectSpace), 102
identifiers, 9, 12
identity (Matrix), 155
if (reserved word), 25
if statement, 18, 25
image (Complex), 154
image_button (CGI), 131
IMAP4 (Internet Message Access Protocol Version 4), 121
inch
      Curses, 137
      Curses::Window, 139
include
      adding properties with, 31
      Module, 98
      security level 4 and, 35
include?
      Array, 61
      CGI, 131
      Enumerable, 68
      Hash, 66
      String, 52
included_modules (Module), 96
index
      Array, 61
      Hash, 66
      String, 52
IndexError class, 94
indexes
      Array, 61
      Hash, 66
indices
      Array, 61
      Hash, 66
induced_from
      Float, 73
      Integer, 71
infinite? (Float), 73
--inf-ruby-mode option, 171
inherited (Class), 99
initialize (database manager), 136
initialize
      Object class and, 47
      objects and, 32
init_screen (Curses), 137
ino (File::Stat), 84
insch
      Curses, 137
      Curses::Window, 139
inspect
      Kernel, 48
      p( ) function and, 42
--inspect option, 171
install (File), 142
instance (Singleton), 160
instance variables, 15, 35
instance_eval (Kernel), 48
instance_method (Module), 96
instance_methods (Module), 97
instance_of? (Kernel), 48
instance_variables (Kernel), 48
Integer class, 70-72, 154
Integer, 42, 55
integer? (Numeric), 70
integers
      ceil and, 69
      conversion specifiers and, 44
      converting from string, 55
      floor and, 70
      Integer( ) function and, 42
      round and, 70
      support for, 9
      trap( ) function and, 46
interfaces
      Curses module and, 136
      DBM class and, 152
      Readline module and, 145
      SDBM class and, 152
      String#pack and, 116
intern (String), 52
interpreter, 5, 7
interpretive programming, 2
Interrupt class, 95
inv (Matrix), 156
inverse (Matrix), 156
invert (Hash), 66
IO class, 33, 43, 75-78, 111
ioctl (IO), 77
IOError class, 94
IP addresses, 112
IPSocket class, 113, 114
IPv6, 112
irb (Interactive Ruby), 171
is_a? (Kernel), 49
isatty (IO), 77
isdst (Time), 107
Ishitsuka, Keiju, 171
ITALY constant, 163
iterators, 2

J[ Top ]
jd (Date), 162
join
      Array, 61
      File, 80
      Thread, 92
      ThreadsWait, 151
join_nowait (ThreadsWait), 151
Julian calendar, 161, 162
JULIAN constant, 163

K[ Top ]
-K option, 6
Kernel module, 39, 47-50
key?
      CGI, 131
      Hash, 66
      Thread, 92
keys
      CGI, 131
      Hash, 66
      h.default and, 65
kill
      Process, 90
      security level 2 and, 34
      Thread, 91, 92
kind_of? (Kernel), 49

L[ Top ]
-l option, 6
lambda function, 42
last
      Array, 61
      Range, 105
lastresp (Net::FTP), 119
ldexp (Math), 74
leap? (Date), 162
length
      Array, 61
      Hash, 66
      MatchData, 58
      Queue, 150
      Range, 105
      String, 54
lexical conventions, 8
libraries
      built-in, 47
      bundled, 3
      loading, 6
      miscellaneous, 160
      predefined variables in, 36
      require( ) function and, 43
      search path for, 7
      web site, 3
_ _LINE_ _ pseudo-variable, 16
--line-length option, 173
lineno (IO), 77
lines (Curses), 137
link (File), 80
list
      Net::FTP, 119
      Net::IMAP, 123
      Thread, 91
      ThreadGroup, 93
listen (Socket), 117
literals, 9-14
ljust (String), 53
-ln option, 173
load
      Kernel, 42
      Marshal, 104
      security level 1, 34
      security level 2, 35
LoadError class, 95
$LOAD_PATH, 34, 37
local (Time), 106
local variables
      assignments and, 16
      class statements and, 30
      for loop and, 27
      method calls and, 20
      module statements and, 31
      predefined, 37
      pseudo-variables and, 16
      scope in blocks, 21
LocalJumpError class, 94
localtime (Time), 107
local_variables function, 42
lock (Mutex), 149
locked? (Mutex), 149
LOCK_EX constant, 82
LOCK_NB constant, 82
LOCK_SH constant, 82
LOCK_UN constant, 82
log (Math), 74
log10 (Math), 74
LOGDIR (environment variable), 7
logical operators, 19
login
      Net::FTP, 119
      Net::IMAP, 123
      Net::Telnet, 128
logout (Net::IMAP), 123
loop function, 42
loops
      abstraction example, 2
      break statement and, 27
      callcc function and, 39
      placing code within, 6
lowercase characters
      capitalize and, 51
      downcase and, 52
      identifiers as, 9
      local variables and, 15
      swapcase and, 55
      upcase and, 57
ls (Net::FTP), 119
lstat (File), 80, 82
lsub (Net::IMAP), 123

M[ Top ]
-m option, 13, 14, 171
M17N (Multilingualization), 178
mail (Net::POPMail), 126
mailboxes, 122, 123
mails (Net::POP3), 125
main (Thread), 91
makedirs (File), 142
map! (Array), 60
map
      Array, 61
      Enumerable, 68
      Matrix, 156
Marshal module, 104, 153
Mastering Regular Expressions (O'Reilly), 12
match (Regexp), 58
MatchData class, 38, 58
Math module, 74, 153
Matrix class, 155, 156
max
      Enumerable, 68
      SizedQueue, 151
maxx (Curses::Window), 139
maxy (Curses::Window), 139
MD5 class, 164
md5 (MD5), 164
mday
      Date, 162
      Time, 107
member?
      Array, 61
      Enumerable, 68
      Hash, 66
members (Struct), 105, 106
message (Exception), 93
messages, 123, 126
method calls, 19, 20
Method class, 49, 101
method groups, 20
method (Kernel), 49
method_added (Module), 98
method_defined? (Module), 97
methods
      accessor methods, 32
      def statement and, 30
      identifiers as, 9
      Kernel instance method, 49
      Ruby, 20-25
      types of visibility, 31
      uninitialized variables and, 15
      version 1.7.1, 177
min
      Enumerable, 68
      Time, 108
minor (Matrix), 156
mjd (Date), 162
mkdir
      Dir, 34, 88
      Net::FTP, 119
mkpath (File), 142
mktime (Time), 106
mode (File::Stat), 84
Module class, 30, 95, 99
module statement, 21, 31
module_eval (Module), 97
module_function (Module), 98
modules
      dynamically loaded, 7
      method groups within, 20
      module statement and, 30
modulo (Numeric), 70
modulus, 70
mo_enter (MonitorMixin), 149
mo_exit (MonitorMixin), 149
mon
      Date, 162
      Time, 108
Monitor class, 148
MonitorMixin module, 148, 149
month
      Date, 162
      Time, 108
MONTHNAMES constant, 163
mon_owner (MonitorMixin), 149
mon_synchronize (MonitorMixin), 149
move
      Curses::Window, 139
      File, 143
mtime
      File, 80, 82
      File::Stat, 85
      Net::FTP, 119
multipart_form (CGI), 131
Mutex class, 149
mv (File), 143

N[ Top ]
-n option, 6, 37
\n option, 14, 138
name
      Class, 99
      Module, 97
NameError, 16, 95
nan? (Float), 73
ndbm library, 152
nesting (Module), 96
Net::APOP class, 126
Net::FTP class, 118-120
Net::HTTP class, 120
Net::IMAP class, 122-125
Net::POP3 class, 125, 126
Net::POPMail class, 126
Net::SMTP class, 127
Net::Telnet class, 127
new
      Array, 59
      CGI, 130
      CGI::Session, 135
      Class, 100
      Complex, 154
      ConditionVariable, 148
      Curses::Window, 138
      Date, 161
      DBM, 152
      Delegator, 157
      DelegatorClass, 158
      Dir, 88
      File, 80
      GetoptLong, 143
      Hash, 65
      initialize method and, 47
      IO, 75
      MD5, 164
      Module, 96
      Net::FTP, 118
      Net::HTTP, 121
      Net::IMAP, 122
      Net::SMTP, 127
      objects and, 32
      Proc, 100
      Queue, 150
      Range, 104
      Rational, 155
      Regexp, 57
      SHA1, 165
      SimpleDelegator, 158
      SizedQueue, 150
      Socket, 117
      String, 50
      Struct, 105
      TCPServer, 114
      TCPSocket, 114
      Thread, 91
      ThreadGroup, 93
      ThreadsWait, 151
      Time, 106
      UDPSocket, 113
      UNIXServer, 116
      UNIXSocket, 115
      Win32API, 147
new1 (Date), 161
new2 (Date), 161
new3 (Date), 161
newline
      begin statement and, 28
      case statement and, 26
      chomp( ) function and, 40
      for statement and, 27
      if statement and, 25
      input record separator, 36
      interpretation of, 8
      puts( ) function and, 43
      return key and, 138
      until statement and, 26
      while statement and, 26
      \Z option and, 14
newsg (Date), 162
neww (Date), 161
next
      Date, 162
      Integer, 71
      String, 53
next statement, 27
next! (String), 53
next_wait (ThreadsWait), 151
nil
      error_message and, 144
      float( ) and, 41
      global constant, 38
      global variables and, 15
      integer( ) and, 42
      next statement and, 27
      pseudo-variable, 16
      select( ) and, 43
nil? (Kernel), 49
NilClass class, 103
nitems (Array), 61
nl (Curses), 138
nlink (File::Stat), 85
nlst (Net::FTP), 119
nocbreak (Curses), 137
nocrmode (Curses), 137
noecho (Curses), 137
--noinspect option, 171
NoMemoryError class, 94
nonl (Curses), 138
nonzero? (Numeric), 70
noop (Net::IMAP), 123
-noprompt option, 172
noraw (Curses), 138
--noreadline option, 171
notify_observers (Observable), 160
NotImplementedError, 95
now (Time), 106
numbers, 9, 69-75, 153
Numeric class
      as inherited class, 154, 155
      built-in library, 69
      Float objects and, 73
      Integer class and, 71
num_waiting (Queue), 150

O[ Top ]
o (conversion specifier), 44
Object class
      as inherited class, 99, 143
      def statement and, 30
      Kernel module and, 39
      OOP tools and, 47
      security level 4 and, 35
object-oriented programming, 1, 29-33
objects
      initializing, 32
      methods and, 20
      singleton methods and, 22
Objects (built-in library), 47
ObjectSpace module, 102
Observable module, 160
oct (String), 53
octals, 14, 44, 53
off (tracer), 171
offset (MatchData), 58
on (tracer), 171
OOP, 1, 29-33
open
      DBM, 152
      Dir, 88
      File, 80
      Kernel, 42
      Net::FTP, 118
      Socket, 117
      TCPServer, 114
      TCPSocket, 114
      Tempfile, 147
      UDPSocket, 113
      UNIXServer, 116
      UNIXSocket, 115
operating system services, 75-90, 136
operators, 8, 17-20, 22
ordering (GetoptLong), 144
out (CGI), 131
output
      overwriting, 5
      split, 5
owned?
      File, 80
      File::Stat, 85
      FileTest, 86
owner (Monitor), 148

P[ Top ]
-p option, 6, 37
p (Kernel), 42
pack (Array), 62
pair (Socket), 117
params (CGI), 132
parse (CGI), 130
ParseDate module, 163
parsedate (ParseDate), 163
pass (Thread), 91
passive (Net::FTP), 119
passwd (Etc), 141
password_field (CGI), 132
passwords, 140
PATH (environment variable), 6, 7, 33
path
      File, 82
      Tempfile, 147
      UNIXSocket, 115
patterns
      regular-expression, 13
      source and, 58
      specifying separator, 5
      wildcards, 87, 123
peeraddr
      IPSocket, 112
      Socket, 117
      UNIXSocket, 115
pid
      IO, 77
      Process, 89
pipe (IO), 75
pipe?
      File, 80
      File::Stat, 85
polar (Complex), 154
pop
      Array, 63
      Net::POPMail, 126
      Queue, 150
POP3 (Post Office Protocol Version 3), 125
popen (IO), 75
popup_menu (CGI), 132
portability, 3
pos
      Dir, 88
      IO, 77
post (Net::HTTP), 121
post_match (MatchData), 58
ppid (Process), 89
prec (Precision), 73
prec_f (Precision), 73
prec_i (Precision), 73
precision (flag), 44
Precision module, 71, 73
pre_match (MatchData), 58
pretty (CGI), 130
print
      IO, 77
      Kernel, 42
      Net::Telnet, 128
printf
      $defout and, 37
      IO, 77
PRIO_PGRP (constant), 90
PRIO_PROCESS (constant), 90
PRIO_USER (constant), 90
private
      in Kernel module, 47
      initialize method and, 32
      initialize methods as, 32
      method visibility, 31
      Module class and, 97
      Object class and, 47
private (Module), 98
private_class_method (Module), 97
private_instance_methods (Module), 97
private_methods (Kernel), 49
Proc class
      built-in library, 100
      completion_proc function and, 146
      proc function and, 42
      set_trace_func( ) function and, 43
      trace_var( ) function and, 46
Process module, 32, 89
profiler, 43, 169
--prompt option, 171
--prompt-mode option, 171
properties, classes and methods, 31
protected, 31, 49
protected (Module), 98
protected_instance_methods (Module), 97
protected_methods (Kernel), 49
protect_signal (PTY), 145
protocols (see specific protocol names)
prune (Find), 142
pseudo-variables, 16
PStore class, 153
PTY module, 145
public, 31, 49
public (Module), 98
public_class_method (Module), 97
public_instance_methods (Module), 97
public_methods (Kernel), 49
push
      Array, 63
      Queue, 150
putbinaryfile (Net::FTP), 119
putc
      IO, 77
      Kernel, 42
puts
      IO, 77
      Kernel, 43
pwd
      Dir, 88
      Net::FTP, 119

Q[ Top ]
Queue class, 150
quiet (GetoptLong), 144
quiet? (GetoptLong), 144
quit (Net::FTP), 120
quote (Regexp), 57
quotient, 70

R[ Top ]
-r option, 6, 34, 166, 170, 171
RAA (Ruby Application Archive), 174
radio_button (CGI), 132
radio_group (CGI), 132
raise, 29, 43, 92
rand function, 43
random numbers, 43, 44
Range class, 104
range operators, 18
RangeError class, 94
rank (Matrix), 156
rassoc (Array), 63
Rational class, 154, 155
Rational (Rational), 155
raw (Curses), 138
RCR (Ruby Change Requests), 179
rdev (File::Stat), 85
read
      Dir, 88
      IO, 77
readable?
      File, 81, 86
      File::Stat, 85
readable_real?
      File, 81
      File::Stat, 85
      FileTest, 86
readchar (IO), 77
readline, 37, 43, 77, 145
Readline module, 145, 146
--readline option, 171
readlines, 43, 75, 77
readlink (File), 81
ready (Net::SMTP), 127
real (Complex), 154
recv (BasicSocket), 112
recvfrom
      IPSocket, 112
      Socket, 117
      UNIXSocket, 115
redo statement, 27
refresh
      Curses, 138
      Curses::Window, 139
Regexp class, 57
RegexpError class, 94
regular? (Matrix), 157
rehash (Hash), 66
reject
      Array, 63
      Enumerable, 68
      Hash, 66
reject!
      Array, 63
      Hash, 66
remainder (Numeric), 70
remainders, 70
remove_const (Module), 98
remove_instance_variable (Kernel), 47
remove_method (Module), 98
rename
      File, 81
      Net::FTP, 120
      Net::IMAP, 123
reopen
      File, 82
      IO, 77
reorganize (GDBM), 152
repetition, characters expressing, 13
replace
      Array, 63
      Hash, 66
      String, 53
require, 34, 42, 43
rescue clause
      exception handling and, 28
      method definitions and, 22
      while statement and, 26
rescue statement, 28
reserved words, 9
reset (CGI), 132
reset_signal (PTY), 145
respond_to? (Kernel), 49
responses (Net::IMAP), 123
restore
      database manager, 136
      Marshal, 104
resume (Net::FTP), 120
retry statement, 28
return_code (Net::FTP), 120
reverse
      Array, 63
      String, 53
reverse!
      Array, 63
      String, 53
reverse_each (Array), 63
rewind
      Dir, 88
      IO, 78
RFC-1123 (date and time formatting), 130
RFC-1321 (MD5 class), 164
rfc1123_date(CGI), 130
ri (Ruby Interactive Reference), 173
rindex
      Array, 63
      String, 53
rjust (String), 53
rmdir
      Dir, 88
      File, 34
      Net::FTP, 120
rm_f (File), 143
root? (PStore), 153
round (Numeric0, 70
row (Matrix), 157
rows (Matrix), 155
row_size (Matrix), 157
row_vector (Matrix), 155
row_vectors (Matrix), 157
Ruby, 176-178
RUBYLIB (environment variable), 7, 34
RUBYLIB_PREFIX (environment variable), 7
ruby-mode for Emacs, 173
RUBYOPT (environment variable), 7, 34
RUBYPATH (environment variable), 7
RUBY_PLATFORM, 38
RUBY_RELEASE_DATE, 38
RUBYSHELL (environment variable), 8
RUBY_VERSION, 38
run (Thread), 92
RuntimeError, 29, 43, 94, 144

S[ Top ]
-S option, 7, 34
-s option, 6, 34, 173
s (conversion specifier), 44
$SAFE
      RUBYSHELL and, 7
      security and, 33
      taint mode and, 7
      variable, 6, 37
safe_level (Thread), 92
safe_unlink (File), 143
scalar (Matrix), 156
scan
      Kernel, 43
      String, 53
screens, 137, 138
ScriptError class, 94, 95
scrolling_list (CGI), 132
SDBM class, 152
search (Net::IMAP), 124
search paths, 7
sec (Time), 108
security, 3, 6, 33-35
SecurityError class, 94
seek
      Dir, 88
      IO, 78
select
      Enumerable, 68
      example, 2
      IO, 76
      Kernel, 43
      Net::IMAP, 124
self (pseudo-variable), 16
send
      BasicSocket, 112
      Kernel, 49
      UDPSocket, 113
send_mail (Net::SMTP), 127
sendmail (Net::SMTP), 127
separators, 5, 36
setgid?
      File, 81
      File::Stat, 85
      FileTest, 86
setgid, security checking, 33
setobj (SimpleDelegator), 158
set_options (GetoptLong), 144
setpgid
      Process, 90
      security level 2 and, 34
setpgrp (Process), 90
setpos
      Curses, 138
      Curses::Window, 139
setpriority
      Process, 90
      security level 2 and, 34
setsid
      Process, 90
      security level 2 and, 34
setsockopt (BasicSocket), 111
set_trace_func (Kernel), 43
setuid?
      File, 81
      File::Stat, 85
      FileTest, 86
setuid, security levels and, 33
sg (Date), 163
SHA1 class, 165
sha1 (SHA1), 165
SHELL, spawned processes and, 8
shift
      Array, 63
      Hash, 66
shutdown (BasicSocket), 111
signa (ConditionVariable), 148
signal handlers, trap( ) function and, 46
SimpleDelegator class, 158
--simple-prompt option, 172
sin (Math), 74
SingleForwardable module, 159
singleton classes, 30
singleton methods, 22, 49
Singleton module, 160
singleton_methods (Kernel), 49
singular? (Matrix), 157
size
      Array, 63
      File, 81
      File::Stat, 85
      FileTest, 86
      Hash, 66
      Integer, 71
      MatchData, 58
      Net::FTP, 120
      Net::POPMail, 126
      Queue, 150
      Range, 105
      String, 54
size?
      File, 81
      File::Stat, 85
      FileTest, 86
SizedQueue class, 150
SJIS (Shift-JIS), 6
sleep (Kernel), 44
slice
      Array, 64
      String, 54
slice!
      Array, 64
      String, 54
SMTP (Simple Mail Transfer Protocol), 126
Socket class, 111, 116, 117
socket?
      File, 81
      File::Stat, 85
      FileTest, 86
Socket::Constants module, 118
socketpair (Socket), 117
sort! (Array), 64
sort
      Array, 64
      Enumerable, 69
      Hash, 66
      Net::IMAP, 124
source (Regexp), 58
spaces
      as whitespace characters, 8
      completion_append_character and, 146
      directives and, 56, 63
      pretty( ) and, 130
spawn (PTY), 145
split
      File, 81
      Kernel, 44
      String, 54
sprintf function, 42, 44
sqrt (Math), 75
square? (Matrix), 157
squeeze (String), 54
squeeze! (String), 54
srand (Kernel), 35, 44
standard library, 110
StandardError class, 28, 94
standend
      Curses, 138
      Curses::Window, 139
standout
      Curses, 138
      Curses::Window, 139
start
      GC, 102
      Net::HTTP, 121
      Net::POP3, 125
      Net::SMTP, 127
      Thread, 92
stat
      File, 81
      IO, 78
status
      Net::FTP, 120
      Thread, 92
status (Net::IMAP), 124
STDERR, 37, 38
$stderr, 37, 38
STDIN, 6, 37, 39
$stdin, 37, 39
STDOUT, 37, 39
$stdout, 37, 39
stdscr (Curses), 138
step
      Date, 163
      Integer, 71
sticky?
      File, 81
      File::Stat, 85
      FileTest, 86
stop (Thread), 92
stop? (Thread), 92
store
      Hash, 67
      Net::IMAP, 124
strftime (Time), 108
String class, 10, 50-57
string
      Kernel, 45
      MatchData, 59
strings
      \A option and, 14
      concatenating, 10
      conversion specifiers and, 44
      converting, 55
      deleting, 51, 52, 54
      delimited, 11
      empty, 146
      length and, 54
      replacing, 52, 55
      source and, 58
      splitting contents, 54
      String class methods and, 50
      substitution in, 11
      types for new( ) class method, 147
      whitespace characters in, 8
strip (String), 54
strip! (String), 54
Struct class, 105
sub
      Kernel, 45
      String, 54
sub!
      Kernel, 45
      String, 54
subscribe (Net::IMAP), 124
substitution, command output to string, 11
subwin (Curses::Window), 139
succ
      Date, 162
      Integer, 72
      String, 53
succ! (String), 53
sum (String), 55
super statement, 24, 32
swapcase (String), 55
swapcase! (String), 55
Symbol class, 23
symlink (File), 81
symlink?
      File, 81
      File::Stat, 85
      FileTest, 86
sync (IO), 78
synchronize
      Monitor, 149
      Mutex, 149
--synopsis option, 173
syntax, 2, 5, 95
SyntaxError class, 95
syscall function, 34, 45
syscopy (File), 143
sysread (IO), 78
system
      Kernel, 45
      Net::FTP, 120
SystemCallError class, 95
SystemExit class, 95
SystemStackError class, 95
syswrite (IO), 78

T[ Top ]
-T option, 6, 33
t (Matrix), 157
taint (Kernel), 49
tainted code/data
      definition of, 33
      $SAFE and, 7, 37
      security, 3, 33
      tainted method and, 49
tainted? (Kernel), 49
tan (Math), 75
TCP (Transmission Control Protocol), 113
TCPServer class, 114
TCPSocket class, 112-114
tel (IO), 77
tell
      Dir, 88
      IO, 78
telnet protocol, 127
telnetmode (Net::Telnet), 128
Tempfile class, 146
terminate (GetoptLong), 144
terminated? (GetoptLong), 144
ternary operator, 19
test, 34, 45
textarea (CGI), 132
text_field (CGI), 132
then (reserved word), 26, 28
Thomas, Dave, 173
Thread class, 91
ThreadGroup class, 93
threads
      built-in library, 91
      classes and, 148
      num_waiting instance method and, 150
      $SAFE in, 33
      security level 4 and, 35
      synchronizing, 148
      ThreadsWait instance, 151
ThreadsWait class, 151
throw function, 46
Time class, 106-109
time formatting, 130
timeout procedure, 43, 164
TimeoutError, 164
times
      Integer, 72
      Time, 106
to_a
      Enumerable, 68
      Hash, 67
      Kernel, 49
      MatchData, 59
today (Date), 162
to_f
      Integer, 72
      String, 55
      Time, 108
to_hash (Hash), 67
to_I (IO), 78
to_i
      IO, 76
      String, 55
      Time, 108
to_int (Integer), 72
to_io (IO), 78
top (Net::POPMail), 126
TOPLEVEL_BINDING, 39
to_proc (Method), 101
to_s (Kernel), 49
to_str (String), 55
tr
      Matrix, 157
      String, 55
tr! (String), 55
trace (Matrix), 157
tracer, 170, 171
Tracer library, 170
--tracer option, 172
trace_var function, 46
transaction (PStore), 153
transpose (Matrix), 157
trap, 34, 46
tr_s (String), 55
tr_s! (String), 55
TRUE constant, 38
true (pseudo-variable), 16
TrueClass class, 103
truncate
      File, 81, 82
      Numeric, 70
      security level 2 and, 34
try_enter (Monitor), 149
try_lock (Mutex), 150
try_mo_enter (MonitorMixin), 149
tty? (IO), 78
tv_sec (Time), 108
tv_usec (Time), 108
type (Kernel), 48
TypeError class, 95

U[ Top ]
u (conversion specifier), 44
UDP (User Data Protocol), 112
UDPSocket class, 113
uid
      File::Stat, 85
      Process, 89
uid_copy (Net::IMAP), 124
uid_fetch (Net::IMAP), 124
uid_search (Net::IMAP), 124
uid_sort (Net::IMAP), 124
uid_store (Net::IMAP), 125
umask (File), 34, 81
unbind (Method), 101
UnboundMethod, 101
undef statement, 24
undefine_finalizer (ObjectSpace0, 103
undef_method (Module), 99
unescape (CGI), 130
unescapeElement (CGI), 130
unescapeHTML (CGI), 130
ungetc (IO), 78
ungetch (Curses), 138
uniq (Array), 64
uniq! (Array), 64
unit (Matrix), 155
Unix domain, 115
UNIXServer class, 116
UNIXSocket class, 115
unless statement, 25
unlink
      Dir, 88
      File, 79
unlock (Mutex), 150
unpack String), 55
unshift (Array), 64
unsubscribe (Net::IMAP), 124
untaint (Kernel), 49
until statement, 26, 27
untrace_var (Kernel), 46
upcase (String), 57
upcase! (String), 57
update
      CGI::Session, 136
      database manager, 136
      Hash, 67
      MD5, 165
      SHA1, 165
uppercase characters
      capitalize and, 51
      constants and, 16
      downcase and, 52
      identifiers as, 9
      swapcase and, 55
      upcase and, 57
upto
      Date, 163
      Integer, 72
      String, 57
URL-encoding, 130
usec (Time), 108
UTC (Coordinated Universal Time), 119
utc (Time), 107, 109
utc? (Time), 109
UTF-8, 6, 178
utime (File), 81

V[ Top ]
-v option, 6, 37, 171, 173, 176
value? (Hash), 67
value (Thread), 93
values
      Hash, 67
      Struct, 106
variables
      environment, 7
      identifiers as, 9
      instance, 35
      predefined, 36-38
      reserved words and, 9
      symbols and, 12
      types of, 15-17
$VERBOSE (predefined variable), 37
verbose mode, 6
--verbose option, 6, 37
version, displaying, 6
--version option, 6, 171, 173
vi editor, 146
vi_editing_mode (Readline), 146

W[ Top ]
-w option, 6, 8, 15, 37
wait
      ConditionVariable, 148
      Process, 90
wait2 (Process), 90
waitfor (Net::Telnet), 129
waitpid (Process), 90
waitpid2 (Process), 90
wakeup (Thread), 93
wday
      Date, 163
      Time, 109
web sites
      current Ruby version, 176
      Ebb download, 174
      eruby download, 174
      RAA, 174
      ri download, 173
      Ruby, 1
      Ruby bug database, 176
      submitting RCRs, 179
      useful libraries, 3
welcome (Net::FTP), 120
when clause, 26
while (reserved word), 26
while statement, 18, 26, 27
whitespace, 8, 12, 14, 54
width (flag), 44
Win32API class, 147
windows, 138, 147
WNOHANG constant, 90
writable?
      File, 81
      File::Stat, 85
      FileTest, 86
writable_real?
      File, 82
      File::Stat, 85
      FileTest, 87
write
      IO, 78
      Net::Telnet, 129
WUNTRACE constant, 90
WUNTRACED constant, 90

X[ Top ]
-X option, 6, 34
$-x variable, 37
-x option, 6, 14
X (conversion specifier), 44
x (conversion specifier), 44
XOR, TrueClass class and, 103

Y[ Top ]
-y option, 6
yday
      Date, 163
      Time, 109
year
      Date, 163
      Time, 109
yield statement, 24, 27
--yydebug option, 6

Z[ Top ]
zero (Matrix), 156
zero?
      File, 82
      File::Stat, 85
      FileTest, 87
      Numeric, 70
ZeroDivisionError class, 95
zone (Time), 109


Return to Ruby in a Nutshell


O'Reilly Home | Privacy Policy

© 2005, O'Reilly Media, Inc.
Website: | Customer Service: | Book issues:

All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.