Ruby, Essential.pdf

Ruby, Essential.pdf

ID:34560822

大?。?.54 MB

頁數(shù):6頁

時間:2019-03-07

Ruby, Essential.pdf_第1頁
Ruby, Essential.pdf_第2頁
Ruby, Essential.pdf_第3頁
Ruby, Essential.pdf_第4頁
Ruby, Essential.pdf_第5頁
資源描述:

《Ruby, Essential.pdf》由會員上傳分享,免費在線閱讀,更多相關內容在學術論文-天天文庫。

1、#30CONTENTSINCLUDE:nRubyLanguageOverviewnSimpleRubyExamplesnIRBEssentialRubynRubyGemsnRubyLanguageReferenceTablesByMelchiorBrislingerandPeterCoopermVisitrefcardz.conHotTipsandMore...AbOUTRUbySImpLERUbyExAmpLESRubyisaneasy-to-learn,dynamic,object-orientedprogrammingDesp

2、itebeinganobject-orientedlanguage,itisnotnecessarylanguagewithdynamictypingandautomaticmemorytouseexplicitlyobject-orientedsyntaxwithinabasicRubymanagement.Whileobject-orientedatheart,itprovidesprogram.Whileeverythingworksonobjects(andmethodsfacilitiesforproceduralandf

3、unctionalprogrammingaswellascalleduponthoseobjects)behindthescenes,youcanwriteaprogramassimplyasthis:extensivesupportforintrospectionandmeta-programming.Ruby’scoreAPI,extensivestandardlibrary,andthousandsofdeffib(i)GetMoreRefcardz!high-qualityexternallibrariesmakeitsui

4、tableformanydifferentifi.zero?0programmingtasksinmultipledisciplines(keyexamplesbeingelsifi==1networkprogramming,Webapplications,shellscripts,data1elseprocessing,andtextmanipulation).fib(i-2)+fib(i-1)RubyisalreadyinstalledonMacOSXandmanyLinuxendenddistributions.ForWind

5、owstheeasiestwaytoinstalleverythingnecessaryistheRubyInstaller(http://rubyinstaller.rubyforge.org).putsfib(10)Thisscriptprintstoscreenthe10thnumberintheFibonacciThisrefcardprovidesaquickreferencetolanguageelementssequence.Itdefinesamethodcalledfibthatreturnstheandmanyi

6、mportantAPIfunctionsforquicklookup.relevantresultfromasimpleif/elsif/elseexpression.Notetheuseofstandardequalitysyntax(==),addition(+),subtractionRUbyLANgUAgEOvERvIEw(-),andmethodcalling(fib(10)),butalsonotethepossibilityofusingmethodsinsomewhatidiomaticways(i.zero?rat

7、herRubyisconsideredtobea“pure”object-orientedlanguagethani==0—thoughthelatterwouldalsowork).TheuseofbecausealmosteveryconceptwithinRubyisobject-orientedi.zero?demonstratescallingamethoduponanobject(wherezone.cominsomesense.Yukihiro“Matz“Matsumoto,Ruby’screator,iistheob

8、ject,andzero?isthemethod).d.wantedtodevelopalanguagethatoperatedonthe“principleofleastsurprise”meaningthatcodeshouldb

當前文檔最多預覽五頁,下載文檔查看全文

此文檔下載收益歸作者所有

當前文檔最多預覽五頁,下載文檔查看全文
溫馨提示:
1. 部分包含數(shù)學公式或PPT動畫的文件,查看預覽時可能會顯示錯亂或異常,文件下載后無此問題,請放心下載。
2. 本文檔由用戶上傳,版權歸屬用戶,天天文庫負責整理代發(fā)布。如果您對本文檔版權有爭議請及時聯(lián)系客服。
3. 下載前請仔細閱讀文檔內容,確認文檔內容符合您的需求后進行下載,若出現(xiàn)內容與標題不符可向本站投訴處理。
4. 下載文檔時可能由于網絡波動等原因無法下載或下載錯誤,付費完成后未能成功下載的用戶請聯(lián)系客服處理。