📄 2.8.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0178)http://proquest.safaribooksonline.com/JVXSL.asp?x=1&mode=section&sortKey=title&sortOrder=asc&view=&xmlid=0-59600-214-9/ruby-CHP-2-SECT-8&open=false&catid=&s=1&b=1&f=1&t=1&c=1&u=1 -->
<HTML><HEAD><TITLE>Safari Tech Books Online - Ruby in a Nutshell</TITLE>
<META http-equiv=Content-Type content="text/html; charset=big5"><LINK
href="2.8.files/style.css" type=text/css rel=STYLESHEET><LINK
href="2.8.files/docsafari.css" type=text/css rel=STYLESHEET>
<SCRIPT>
function OpenWin(url, w, h)
{
if(!w) w = 400;
if(!h) h = 300;
window.open(url, "_new", "width=" + w + ",height=" + h + ",menubar=no,toobar=no,scrollbars=yes", true);
}
</SCRIPT>
<META content="MSHTML 6.00.2462.0" name=GENERATOR></HEAD>
<BODY leftMargin=0 topMargin=0 marginheight="0" marginwidth="0"><A
name=toppage></A><SPAN class=v2></SPAN>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR vAlign=top>
<TD align=left bgColor=black><IMG src="2.8.files/SafariLogo.gif"
align=middle borner="0"></TD>
<TD align=right bgColor=black><IMG src="2.8.files/pqlogo.gif"
align=right></TD></TR>
<TR vAlign=center align=right height=30>
<TD bgColor=#ff9900></TD>
<TD class=PQBannerText vAlign=center align=left bgColor=#993300><IMG
src="2.8.files/jslredcurve.jpg" align=absMiddle><B>ProQuest Information
and Learning Company </B></TD></TR></TBODY></TABLE>
<TABLE class=topmenu height=20 cellSpacing=1 cellPadding=0 width="100%"
border=0>
<TBODY>
<TR>
<TD width=150></TD>
<TD class=navbtn noWrap align=middle width=65><A class=navbtn
title="Go to home page"
href="http://proquest.safaribooksonline.com/JVXSL.asp?x=1&mode=Home&sortKey=title&sortOrder=asc&view=&xmlid=&open=false&catid=&s=1&b=1&f=1&t=1&c=1&u=1&srchText=">Home</A></TD>
<TD class=navbtn noWrap align=middle width=70><A class=navbtn
title="Go to My Safari"
href="http://proquest.safaribooksonline.com/JVXSL.asp?x=1&mode=MySafari&sortKey=title&sortOrder=asc&view=&xmlid=&open=false&catid=&s=1&b=1&f=1&t=1&c=1&u=1&srchText=">Desktop</A></TD>
<TD class=navbtn noWrap align=middle width=90><A class=navbtn
title="Show the books on your bookshelf"
href="http://proquest.safaribooksonline.com/JVXSL.asp?x=1&mode=MyBookshelf&sortKey=title&sortOrder=asc&view=&xmlid=&open=false&catid=&s=1&b=1&f=1&t=1&c=1&u=1&srchText=">Bookshelf</A></TD>
<TD class=navbtn noWrap align=middle width=125><A class=navbtn
title="Display a list of recent searches"
href="http://proquest.safaribooksonline.com/JVXSL.asp?x=1&mode=MyRecentSearches&sortKey=title&sortOrder=asc&view=&xmlid=&open=false&catid=&s=1&b=1&f=1&t=1&c=1&u=1&srchText=">Recent
Searches</A></TD>
<TD class=navbtn noWrap align=middle width=110><A class=navbtn
title="Display a list of recently visited pages"
href="http://proquest.safaribooksonline.com/JVXSL.asp?x=1&mode=MyRecentPages&sortKey=title&sortOrder=asc&view=&xmlid=&open=false&catid=&s=1&b=1&f=1&t=1&c=1&u=1&srchText=">Recent
Pages</A></TD>
<TD class=logout noWrap align=right> <A class=v2
href="http://proquest.safaribooksonline.com/JVXSL.asp?mode=Logout">Logout</A>
</TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR vAlign=top>
<TD width=190 rowSpan=2>
<FORM action=JVXSL.asp method=post><INPUT type=hidden name=catid><INPUT
type=hidden value=1 name=s><INPUT type=hidden value=1 name=b><INPUT
type=hidden value=1 name=t><INPUT type=hidden value=1 name=f><INPUT
type=hidden value=1 name=c><INPUT type=hidden value=1 name=l>
<DIV style="OVERFLOW-X: hidden; WIDTH: 190px">
<TABLE class=menuLeft cellSpacing=0 cellPadding=0 width=190 border=0>
<TBODY>
<TR>
<TD align=right width=1 rowSpan=3><IMG height=1
src="2.8.files/spacer.gif" width=1 border=0></TD>
<TD class=menuLeft align=middle width=188><A
href="http://proquest.safaribooksonline.com/JVXSL.asp?x=1&mode=section&sortKey=title&sortOrder=asc&view=&xmlid=0-59600-214-9/ruby-CHP-2-SECT-8&open=false&catid=&s=0&b=1&f=1&t=1&c=1&u=1"><IMG
src="2.8.files/left_search.gif" border=0></A>
<TABLE id=Out1details cellSpacing=0 cellPadding=0 width="92%"
border=0>
<TBODY>
<TR>
<TD colSpan=4 height=5></TD></TR>
<TR>
<TD colSpan=4 height=5></TD></TR>
<TR>
<TD colSpan=4><INPUT type=hidden value=book name=view><INPUT
tabIndex=1 size=15 name=srchtext><SPAN class=v2> <INPUT title="Execute the search" type=submit value=Go name=go></SPAN></TD></TR>
<TR>
<TD class=a2 vAlign=center colSpan=4 height=25><INPUT
type=checkbox value=1 name=code> Code Fragments Only</TD></TR>
<TR vAlign=top>
<TD class=v2 colSpan=4 height=25> <A class=a1
title="Advanced search features"
href="http://proquest.safaribooksonline.com/JVXSL.asp?x=1&mode=search&sortKey=title&sortOrder=asc&view=&xmlid=&open=false&catid=&s=1&b=1&f=1&t=1&c=1&u=1&srchText=">Advanced
Search</A></TD></TR></TBODY></TABLE><A
href="http://proquest.safaribooksonline.com/JVXSL.asp?x=1&mode=section&sortKey=title&sortOrder=asc&view=&xmlid=0-59600-214-9/ruby-CHP-2-SECT-8&open=false&catid=&s=1&b=1&f=1&t=0&c=1&u=1"><IMG
height=19 src="2.8.files/left_tbl_conts.gif" width=188
border=0></A><BR>
<TABLE class=menuLeft cellSpacing=1 cellPadding=1 width="100%"
border=0>
<TBODY>
<TR>
<TD class=v2 colSpan=16 height=18>
<TABLE cellSpacing=0 cellPadding=3 width="100%" align=center
border=0>
<TBODY>
<TR align=middle>
<TD vAlign=top colSpan=2 height=10><IMG height=16
src="2.8.files/down_arrow.gif" width=55></TD></TR>
<TR>
<TD vAlign=top align=middle width=53 height=54><A
href="http://proquest.safaribooksonline.com/JVXSL.asp?x=1&mode=section&sortKey=title&sortOrder=asc&view=&xmlid=0-59600-214-9&open=false&catid=&s=1&b=1&f=1&t=1&c=1&u=1&srchText="><IMG
src="2.8.files/ruby_icon.gif" width=36 border=0></A></TD>
<TD class=v2 vAlign=top width=109><A class=v1
href="http://proquest.safaribooksonline.com/JVXSL.asp?x=1&mode=section&sortKey=title&sortOrder=asc&view=&xmlid=0-59600-214-9&open=false&catid=&s=1&b=1&f=1&t=1&c=1&u=1&srchText=">Ruby
in a Nutshell</A><BR></TD></TR>
<TR vAlign=top>
<TD class=a3 colSpan=2
height=20> </TD></TR></TBODY></TABLE></TD></TR>
<TR vAlign=top>
<TD class=v2 width=14 height=18><IMG height=9
src="2.8.files/left_note.gif" width=14 vspace=4 border=0></TD>
<TD class=v2 colSpan=15><A class=v2 title=Copyright
href="http://proquest.safaribooksonline.com/JVXSL.asp?x=1&mode=section&sortKey=title&sortOrder=asc&view=&xmlid=0-59600-214-9/copyright&open=true&catid=&s=1&b=1&f=1&t=1&c=1&u=1&srchText=">Copyright</A></TD></TR>
<TR vAlign=top>
<TD class=v2 width=14 height=18><IMG height=9
src="2.8.files/left_note.gif" width=14 vspace=4 border=0></TD>
<TD class=v2 colSpan=15><A class=v2 title=Foreword
href="http://proquest.safaribooksonline.com/JVXSL.asp?x=1&mode=section&sortKey=title&sortOrder=asc&view=&xmlid=0-59600-214-9/ruby-FOREWORD&open=true&catid=&s=1&b=1&f=1&t=1&c=1&u=1&srchText=">Foreword</A></TD></TR>
<TR vAlign=top>
<TD class=v2 width=14 height=18><A
href="http://proquest.safaribooksonline.com/JVXSL.asp?x=1&mode=section&sortKey=title&sortOrder=asc&view=&xmlid=0-59600-214-9/ruby-PREF&open=true&catid=&s=1&b=1&f=1&t=1&c=1&u=1&srchText="><IMG
height=9 src="2.8.files/sign_plus.gif" width=14 vspace=4
border=0></A></TD>
<TD class=v2 colSpan=15><A class=v2 title=Preface
href="http://proquest.safaribooksonline.com/JVXSL.asp?x=1&mode=section&sortKey=title&sortOrder=asc&view=&xmlid=0-59600-214-9/ruby-PREF&open=true&catid=&s=1&b=1&f=1&t=1&c=1&u=1&srchText=">Preface</A></TD></TR>
<TR vAlign=top>
<TD class=v2 width=14 height=18><A
href="http://proquest.safaribooksonline.com/JVXSL.asp?x=1&mode=section&sortKey=title&sortOrder=asc&view=&xmlid=0-59600-214-9/ruby-CHP-1&open=true&catid=&s=1&b=1&f=1&t=1&c=1&u=1&srchText="><IMG
height=9 src="2.8.files/sign_plus.gif" width=14 vspace=4
border=0></A></TD>
<TD class=v2 colSpan=15><A class=v2 title=Introduction
href="http://proquest.safaribooksonline.com/JVXSL.asp?x=1&mode=section&sortKey=title&sortOrder=asc&view=&xmlid=0-59600-214-9/ruby-CHP-1&open=true&catid=&s=1&b=1&f=1&t=1&c=1&u=1&srchText=">Introduction</A></TD></TR>
<TR vAlign=top>
<TD class=v2 width=14 height=18><A
href="http://proquest.safaribooksonline.com/JVXSL.asp?x=1&mode=section&sortKey=title&sortOrder=asc&view=&xmlid=0-59600-214-9/ruby-CHP-2&open=false&catid=&s=1&b=1&f=1&t=1&c=1&u=1&srchText="><IMG
height=9 src="2.8.files/sign_minus.gif" width=14 vspace=4
border=0></A></TD>
<TD class=v2 colSpan=15><A class=v2 title="Language Basics"
href="http://proquest.safaribooksonline.com/JVXSL.asp?x=1&mode=section&sortKey=title&sortOrder=asc&view=&xmlid=0-59600-214-9/ruby-CHP-2&open=true&catid=&s=1&b=1&f=1&t=1&c=1&u=1&srchText=">Language
Basics</A></TD></TR>
<TR vAlign=top>
<TD class=v2> </TD>
<TD class=v2 width=14 height=18><IMG height=9
src="2.8.files/left_note.gif" width=14 vspace=4 border=0></TD>
<TD class=v2 colSpan=14><A class=v2
title="Command-Line Options"
href="http://proquest.safaribooksonline.com/JVXSL.asp?x=1&mode=section&sortKey=title&sortOrder=asc&view=&xmlid=0-59600-214-9/ruby-CHP-2-SECT-1&open=true&catid=&s=1&b=1&f=1&t=1&c=1&u=1&srchText=">Command-Line
Options</A></TD></TR>
<TR vAlign=top>
<TD class=v2> </TD>
<TD class=v2 width=14 height=18><IMG height=9
src="2.8.files/left_note.gif" width=14 vspace=4 border=0></TD>
<TD class=v2 colSpan=14><A class=v2
title="Environment Variables"
href="http://proquest.safaribooksonline.com/JVXSL.asp?x=1&mode=section&sortKey=title&sortOrder=asc&view=&xmlid=0-59600-214-9/ruby-CHP-2-SECT-2&open=true&catid=&s=1&b=1&f=1&t=1&c=1&u=1&srchText=">Environment
Variables</A></TD></TR>
<TR vAlign=top>
<TD class=v2> </TD>
<TD class=v2 width=14 height=18><IMG height=9
src="2.8.files/left_note.gif" width=14 vspace=4 border=0></TD>
<TD class=v2 colSpan=14><A class=v2
title="Lexical Conventions"
href="http://proquest.safaribooksonline.com/JVXSL.asp?x=1&mode=section&sortKey=title&sortOrder=asc&view=&xmlid=0-59600-214-9/ruby-CHP-2-SECT-3&open=true&catid=&s=1&b=1&f=1&t=1&c=1&u=1&srchText=">Lexical
Conventions</A></TD></TR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -