1. ã¯ããã«: Rubyãšã¯?
Rubyã¯ã1990幎代åé ã«æ¥æ¬ã§çãŸããããã°ã©ãã³ã°èšèªã§ãããã®èšèªã¯ããã®ç¬ç¹ãªç¹åŸŽãšå²åŠã«ãããå€ãã®ããã°ã©ããŒããæãããŠããŸãããã§ã¯ãRubyãã©ã®ãããªèæ¯ãæã¡ãã©ã®ãããªç¹åŸŽãããã®ãã詳ããèŠãŠãããŸãããã
1.1 Rubyã®æŽå²ãšç¹åŸŽ
Rubyã®æŽå²ã¯ã1993幎ã«æ¥æ¬ã®ããã°ã©ããŒã§ãããŸã€ããšããã²ãæ°ã«ãã£ãŠéçºãå§ãŸããŸããã圌ã®ç®çã¯ã人éã®èªç¶ãªèšèªã«è¿ã圢ã§ã³ãŒããæžãããšãã§ããèšèªãäœæããããšã§ããããã®çµæãRubyã¯ãããã°ã©ãã®ããã®ããã°ã©ãã³ã°èšèªããšããŠèªçããŸããã
ãã®èšèªã®æ倧ã®ç¹åŸŽã¯ããªããžã§ã¯ãæåã®ããã°ã©ãã³ã°èšèªã§ããããšã§ããããã«ãããããŒã¿ãšãã®ããŒã¿ã«é¢é£ããæäœãäžã€ã®ããªããžã§ã¯ãããšããŠæ±ãããšãã§ããŸãããŸããRubyã¯åçåä»ããæ¡çšããŠãããå€æ°ã®åãæ瀺çã«å®£èšããå¿ èŠããããŸããã
ããã«ãRubyã®ã³ãŒãã¯éåžžã«èªã¿ããããæžãããããšããç¹åŸŽããããŸããããã¯ããŸã€ããšããã²ãæ°ããããã°ã©ã ã¯äººéã®ããã«ããããŠæ©æ¢°ã®ããã«ããšããå²åŠã®ããšã§èšèšããããã§ãã
1.2 Rubyã®äººæ°ãšãã®çç±
Rubyããªãããã»ã©ãŸã§ã«äººæ°ãããã®ãããã®çç±ã¯ããã€ãèããããŸãããŸãããRuby on Railsããšãããã¬ãŒã ã¯ãŒã¯ã®ç»å Žã«ãããRubyã¯æ¥éã«æ³šç®ã济ã³ãããã«ãªããŸããããã®ãã¬ãŒã ã¯ãŒã¯ã䜿çšããããšã§ãWebã¢ããªã±ãŒã·ã§ã³ã®éçºãéåžžã«ç°¡åã«ãªããŸããã
ãŸããRubyã®ã³ãã¥ããã£ã¯éåžžã«æŽ»çºã§ãããå€ãã®ã©ã€ãã©ãªãããŒã«ãæäŸãããŠããŸããããã«ãããéçºè ã¯å¹ççã«ã¢ããªã±ãŒã·ã§ã³ãéçºããããšãã§ããŸãã
ããã«ãRubyã¯ãªãŒãã³ãœãŒã¹ã®èšèªã§ãããç¡æã§å©çšããããšãã§ããŸãããã®ãããå€ãã®éçºè ãRubyãåŠã³ã䜿çšããããã«ãªããŸããã
以äžã®ãããªçç±ãããRubyã¯ä»æ¥ã§ãå€ãã®éçºè ããæ¯æãåããŠããŸãã
2. RubyåŠç¿ã®éèŠæ§
çŸä»£ã®æè¡ç€ŸäŒã«ãããŠãããã°ã©ãã³ã°ã¯å€ãã®åéã§å¿ é ã®ã¹ãã«ãšãªã£ãŠããŸãããã®äžã§ããRubyã¯ãã®ç¬ç¹ã®ç¹åŸŽãšå©äŸ¿æ§ãããå€ãã®éçºè ã«éžã°ããŠããŸããã§ã¯ãRubyãåŠã¶ããšã®éèŠæ§ãšã¯äœã§ããããã
2.1 ããã°ã©ãã³ã°èšèªãšããŠã®Rubyã®äœçœ®ã¥ã
Rubyã¯ãå€ãã®ããã°ã©ãã³ã°èšèªã®äžã§ããäžçŽè åããšããŠäœçœ®ã¥ããããããšãå€ãã§ãããããããã®ææ³ã®ã·ã³ãã«ããçŽæçãªèšè¿°æ¹æ³ãããåå¿è ã«ãéåžžã«åãçµã¿ãããèšèªãšèšããŸããç¹ã«ãWebã¢ããªã±ãŒã·ã§ã³ã®éçºã«ãããŠã¯ãRuby on Railsãšãããã¬ãŒã ã¯ãŒã¯ãå©çšããããšã§ãçæéã§ã®éçºãå¯èœãšãªããŸãã
ãŸããRubyã¯ãªãŒãã³ãœãŒã¹ã®èšèªã§ãããããäžçäžã®éçºè ããã®éçºãæ¹åã«åãçµãã§ããŸããããã«ãããRubyã®ãšã³ã·ã¹ãã ã¯æ¥ã æé·ããŠãããææ°ã®æè¡ãã¬ã³ãã«ãè¿ éã«å¯Ÿå¿ããããšãã§ããŸãã
2.2 RubyãåŠã¶ããšã§åŸãããã¹ãã«ãšã¯
RubyãåŠã¶ããšã§ããŸãæãåŸãããã¹ãã«ã¯ãWebã¢ããªã±ãŒã·ã§ã³ã®éçºèœåã§ããRuby on Railsã䜿çšããããšã§ãããŒã¿ããŒã¹ã®æäœããŠãŒã¶ãŒèªèšŒãAPIã®é£æºãªã©ãWebã¢ããªã±ãŒã·ã§ã³éçºã«å¿ èŠãªç¥èãç·åçã«åŠã¶ããšãã§ããŸãã
ããã«ãRubyãåŠã¶ããšã§ããªããžã§ã¯ãæåããã°ã©ãã³ã°ã®èãæ¹ãããã¹ãé§åéçºãšãã£ãããœãããŠã§ã¢éçºã®ãã¹ããã©ã¯ãã£ã¹ã«ã觊ããããšãã§ããŸãããããã®ã¹ãã«ã¯ãRubyã ãã§ãªããä»ã®ããã°ã©ãã³ã°èšèªããã¬ãŒã ã¯ãŒã¯ãåŠã¶éã«ãéåžžã«åœ¹ç«ã¡ãŸãã
æåŸã«ãRubyã®ã³ãã¥ããã£ã¯éåžžã«æŽ»çºã§ãããå€ãã®æ å ±äº€æãç¥èã®å ±æãè¡ãããŠããŸãããã®ã³ãã¥ããã£ã«åå ããããšã§ãææ°ã®æè¡æ å ±ãåŸãã ãã§ãªããåãèå³ãæã€ä»²éãšã®ãããã¯ãŒãã³ã°ã®æ©äŒãå¢ããŸãã
以äžã®ããã«ãRubyãåŠã¶ããšã¯ãåã«äžã€ã®ããã°ã©ãã³ã°èšèªãåŠã¶ä»¥äžã®äŸ¡å€ããããŸããããããã®æ代ã«ãããŠãæè¡ã®é²åãšãšãã«èªèº«ã®ã¹ãã«ãã¢ããããŒãããŠããããšã¯éåžžã«éèŠã§ãã
3. RubyåŠç¿ã®ã¹ã¿ãŒãã©ã€ã³
ããã°ã©ãã³ã°ã®åŠç¿ãå§ããéãæåã®äžæ©ãæãéèŠã§ããç¹ã«ãRubyã®ãããªç¬ç¹ã®ç¹åŸŽãæã€èšèªãåŠã¶å Žåãé©åãªæºåãšåºæ¬çãªç¥èã®ç¿åŸãæ¬ ãããŸããããã®ã»ã¯ã·ã§ã³ã§ã¯ãRubyã®åŠç¿ãã¹ã ãŒãºã«é²ããããã®ã¹ã¿ãŒãã©ã€ã³ã«ã€ããŠè©³ãã解説ããŸãã
3.1 åŠç¿ãå§ããåã®æºå
ãŸããRubyã®åŠç¿ãå§ããåã«ãç°å¢ã®ã»ããã¢ãããå¿ èŠã§ããå€ãã®ãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã«ã¯ãRubyã®ã€ã³ã¹ããŒã©ãçšæãããŠããŸãããããå©çšããããšã§ãç°¡åã«Rubyã®ç°å¢ãæ§ç¯ããããšãã§ããŸãã
次ã«ãããã¹ããšãã£ã¿ã®éžæã§ããRubyã®ã³ãŒããæžãããã®å°çšã®ãšãã£ã¿ãå€æ°ååšããŸãããåå¿è ã®å Žåãã·ã³ãã«ãªããã¹ããšãã£ã¿ããå§ããããšãããããããŸããããã«ãããäœèšãªæ©èœã«æ°ãåãããããšãªããRubyã®åºæ¬ãåŠã¶ããšãã§ããŸãã
æåŸã«ãåŠç¿ã®ç®æšèšå®ã§ããå ·äœçãªç®æšãæã€ããšã§ãåŠç¿ã®ã¢ãããŒã·ã§ã³ãç¶æãããããªããŸããäŸãã°ãç°¡åãªWebã¢ããªã±ãŒã·ã§ã³ã®å¶äœããç¹å®ã®åé¡ã®è§£æ±ºãªã©ãèªåã®èå³ãããŒãºã«åãããç®æšãèšå®ããŸãããã
3.2 Rubyã®åºæ¬çãªææ³ãšæ§é
Rubyã®ææ³ã¯ãä»ã®å€ãã®ããã°ã©ãã³ã°èšèªãšæ¯èŒããŠããéåžžã«çŽæçã§ã·ã³ãã«ã§ãããããããã®èåŸã«ã¯ç¬èªã®å²åŠãèãæ¹ãååšããŸããããã§ã¯ãRubyã®åºæ¬çãªææ³ãšæ§é ã«ã€ããŠç°¡åã«è§£èª¬ããŸãã
ãŸããRubyã®å€æ°ã¯åçåä»ããæ¡çšããŠããŸããããã«ãããå€æ°ã®åãæ瀺çã«å®£èšããå¿ èŠããããŸããããŸããRubyã®å€æ°åã¯ã¹ããŒã¯ã±ãŒã¹ã䜿çšããã®ãäžè¬çã§ãã
次ã«ãRubyã®å¶åŸ¡æ§é ã§ããRubyã«ã¯ãifæãwhileæãforæãªã©ãåºæ¬çãªå¶åŸ¡æ§é ãçšæãããŠããŸãããããã®æ§é ãå©çšããããšã§ãæ§ã ãªæ¡ä»¶ãç¹°ãè¿ãåŠçãå®è£ ããããšãã§ããŸãã
æåŸã«ãRubyã®é¢æ°ãã¡ãœããã«ã€ããŠã§ããRubyã§ã¯ãé¢æ°ãã¡ãœãããå®çŸ©ããéã«ãdefããŒã¯ãŒãã䜿çšããŸãããŸããRubyã®é¢æ°ãã¡ãœããã¯ãæåŸã«è©äŸ¡ãããåŒã®å€ãèªåçã«è¿ãç¹åŸŽããããŸãã
以äžã®ããã«ãRubyã®åºæ¬çãªææ³ãæ§é ã¯ã·ã³ãã«ã§çŽæçã§ãããããããã®èåŸã«ã¯æ·±ãå²åŠãèãæ¹ãååšãããããç¶ç¶çãªåŠç¿ãšå®è·µãå¿ èŠã§ãã
4. ããããã®RubyåŠç¿ãµã€ã
ããã°ã©ãã³ã°ã®åŠç¿ãé²ããäžã§ãé©åãªåŠç¿ãµã€ãã®éžæã¯éåžžã«éèŠã§ããç¹ã«ãRubyã®ãããªç¬ç¹ã®ç¹åŸŽãæã€èšèªãåŠã¶å Žåãåå¿è ããäžçŽè ãŸã§å¹ åºã察å¿ãããµã€ããæ±ããããŸãããã®ã»ã¯ã·ã§ã³ã§ã¯ãRubyã®åŠç¿ã«ããããã®ãµã€ãã玹ä»ããããããã®ç¹åŸŽãéžã³æ¹ã«ã€ããŠè©³ãã解説ããŸãã
4.1 ç¡æã§å©çšã§ããåŠç¿ãµã€ã
åããŠRubyãåŠã¶æ¹ã«ãšã£ãŠãç¡æã§ã¢ã¯ã»ã¹ã§ããåŠç¿ãµã€ãã¯éåžžã«é åçã§ããå€ãã®ãµã€ãã§ã¯ãRubyã®åºæ¬çãªææ³ãæ§é ãããå®è·µçãªã¢ããªã±ãŒã·ã§ã³ã®éçºãŸã§ãå¹ åºãå 容ãæäŸãããŠããŸãã
äŸãã°ãRubyå ¬åŒããã¥ã¡ã³ãã¯ãRubyã®å šãŠã®æ©èœãã¡ãœããã«ã€ããŠè©³ãã解説ãããŠãããåå¿è ããäžçŽè ãŸã§åèã«ããããšãã§ããŸãããŸããRubyã®ãã¥ãŒããªã¢ã«ãµã€ãã§ã¯ãå®éã«ã³ãŒããæžããªããåŠç¿ãé²ããããšãã§ããç解ãæ·±ããã®ã«åœ¹ç«ã¡ãŸãã
4.2 ææã®åŠç¿ãµã€ããšãã®ç¹åŸŽ
äžæ¹ãææã®åŠç¿ãµã€ãã¯ãç¡æã®ãµã€ããããããã«æ·±ãå 容ãå°éçãªãããã¯ãåŠã¶ããšãã§ããŸããå€ãã®ææãµã€ãã§ã¯ãããã®éçºè ãæè²è ãäœæããã«ãªãã¥ã©ã ãæäŸãããŠãããå¹ççã«åŠç¿ãé²ããããšãã§ããŸãã
ç¹ã«ããªã³ã©ã€ã³ã³ãŒã¹ããããªãã¥ãŒããªã¢ã«ã¯ãèŠèŠçã«åŠç¿å 容ãç解ãããããå®éã®éçºã®æµãããã¹ããã©ã¯ãã£ã¹ãåŠã¶ã®ã«éåžžã«åœ¹ç«ã¡ãŸãããŸããææãµã€ãã®äžã«ã¯ãã¡ã³ã¿ãŒãµããŒããã³ãŒãã¬ãã¥ãŒãªã©ãåŠç¿ããµããŒãããè¿œå ã®ãµãŒãã¹ãæäŸããŠãããšããããããŸãã
4.3 åŠç¿ãµã€ãã®éžã³æ¹
Rubyã®åŠç¿ãµã€ããéžã¶éã®ãã€ã³ãã¯ãèªåã®åŠç¿ã¹ã¿ã€ã«ãç®çã«åãããŠéžã¶ããšã§ããäŸãã°ãããžã¥ã¢ã«ãªåŠç¿ãåŸæãªæ¹ã¯ããããªãã¥ãŒããªã¢ã«ãæäŸããŠãããµã€ããéžã¶ãšè¯ãã§ãããããŸããå®éã®ãããžã§ã¯ããäœæããªããåŠã³ããæ¹ã¯ãå®è·µçãªã«ãªãã¥ã©ã ãæäŸããŠãããµã€ããéžã¶ãšå¹æçã§ãã
ããã«ããµã€ãã®æŽæ°é »åºŠãã³ãã¥ããã£ã®æŽ»çºãããåŠç¿ãµã€ãã®éžã³æ¹ã®ãã€ã³ããšãªããŸããææ°ã®æè¡ãã¬ã³ããæ å ±ãåŠã¶ããã«ã¯ãå®æçã«å 容ãæŽæ°ãããŠãããµã€ããéžã¶ããšãéèŠã§ãã
以äžã®ããã«ãRubyã®åŠç¿ãµã€ããéžã¶éã¯ãèªåã®ããŒãºãåŠç¿ã¹ã¿ã€ã«ã«åãããŠãé©åãªãµã€ããéžã¶ããšãéèŠã§ããããã«ãããå¹ççã«åŠç¿ãé²ããããšãã§ããŸãã
5. RubyåŠç¿ã®ã³ããšå¹æçãªé²ãæ¹
ããã°ã©ãã³ã°ã®åŠç¿ã¯ãåã«ç¥èãå¢ããã ãã§ãªããå®è·µçãªã¹ãã«ãç¿åŸããéçšã§ããããŸããRubyã®åŠç¿ãäŸå€ã§ã¯ãããŸããããã®ã»ã¯ã·ã§ã³ã§ã¯ãRubyã®åŠç¿ãå¹æçã«é²ããããã®ã³ããæ¹æ³ã«ã€ããŠè©³ãã解説ããŸãã
5.1 æ¯æ¥ã®ç¶ç¶çãªåŠç¿ã®éèŠæ§
ããã°ã©ãã³ã°ã®åŠç¿ã«ãããŠãç¶ç¶ã¯åã§ããç¹ã«ãRubyã®ãããªç¬ç¹ã®ç¹åŸŽãæã€èšèªãåŠã¶å Žåãæ¯æ¥å°ããã€åŠç¿ããããšã§ãç¥èãã¹ãã«ãå®çãããããšãã§ããŸãã
ç¶ç¶çãªåŠç¿ã®ã³ãã¯ãæ¯æ¥ã®åŠç¿æéãåºå®ããããšã§ããäŸãã°ãæ¯æ¥æã®30åãå€ã®1æéãRubyã®åŠç¿ã«å ãŠãããšã§ãåŠç¿ã®ãªãºã ãäœãããšãã§ããŸãããŸããåŠç¿ã®èšé²ãã€ããããšã§ãèªåã®é²æãå¯èŠåããã¢ãããŒã·ã§ã³ãç¶æããã®ã«åœ¹ç«ã¡ãŸãã
5.2 å®è·µãåãå ¥ããåŠç¿æ¹æ³
Rubyã®åŠç¿ã«ãããŠãå®è·µçãªã¹ãã«ã®ç¿åŸã¯éåžžã«éèŠã§ããç¹ã«ãWebã¢ããªã±ãŒã·ã§ã³ã®éçºãããŒã¿ããŒã¹ã®æäœãªã©ãå®éã®éçºç°å¢ã§ã®ã¹ãã«ãæ±ããããå Žé¢ãå€ãã§ãã
å®è·µãåãå ¥ããåŠç¿æ¹æ³ã®ã³ãã¯ãå°ããªãããžã§ã¯ããäœæããããšã§ããäŸãã°ãç°¡åãªWebã¢ããªã±ãŒã·ã§ã³ãããŒã«ãäœæããããšã§ãRubyã®åºæ¬çãªææ³ãæ§é ã ãã§ãªããå®éã®éçºã®æµãããã¹ããã©ã¯ãã£ã¹ãåŠã¶ããšãã§ããŸãã
5.3 ãã©ãã«æã®å¯ŸåŠæ³ãšãµããŒã
ããã°ã©ãã³ã°ã®åŠç¿ãé²ããŠããäžã§ããã©ãã«ããšã©ãŒã«çŽé¢ããããšã¯é¿ããããŸããããããããããã®ãã©ãã«ãä¹ãè¶ããããšã§ãæ·±ãç解ãæ°ããç¥èãåŸãããšãã§ããŸãã
ãã©ãã«æã®å¯ŸåŠæ³ãšããŠã¯ããŸããšã©ãŒã¡ãã»ãŒãžããã£ãããšèªãããšãéèŠã§ããRubyã®ãšã©ãŒã¡ãã»ãŒãžã¯éåžžã«ãããããããåå ã解決æ¹æ³ã瀺ãããŠããããšãå€ãã§ãããŸãããªã³ã©ã€ã³ã®ã³ãã¥ããã£ããã©ãŒã©ã ãå©çšããããšã§ãä»ã®éçºè ããã®ãµããŒããã¢ããã€ã¹ãåŸãããšãã§ããŸãã
以äžã®ããã«ãRubyã®åŠç¿ãå¹æçã«é²ããããã®ã³ããæ¹æ³ã¯å€å²ã«ããããŸããããããæãéèŠãªã®ã¯ãèªåèªèº«ã®ããŒã¹ã§åŠç¿ãé²ããããšã§ããããã«ãããæç¶çãªåŠç¿ãšã¹ãã«ã®åäžãå®çŸããããšãã§ããŸãã
6. RubyåŠç¿ããµããŒãããè¿œå ãªãœãŒã¹
ããã°ã©ãã³ã°ã®åŠç¿ã¯ãå€å²ã«ããããªãœãŒã¹ã掻çšããããšã§ãããæ·±ãç解ãå®è·µçãªã¹ãã«ãç¿åŸããããšãã§ããŸããRubyã®åŠç¿ãäŸå€ã§ã¯ãããŸããããã®ã»ã¯ã·ã§ã³ã§ã¯ãRubyã®åŠç¿ããµããŒãããè¿œå ã®ãªãœãŒã¹ã«ã€ããŠè©³ãã玹ä»ããŸãã
6.1 æžç±ããªã³ã©ã€ã³ã³ãã¥ããã£ã®çŽ¹ä»
æžç±ã¯ãæ·±ãç解ãæ±ããæ¹ã«ãšã£ãŠãéåžžã«æå¹ãªãªãœãŒã¹ã§ããå€ãã®æžç±ã§ã¯ãRubyã®åºæ¬çãªææ³ãæ§é ãããå®è·µçãªã¢ããªã±ãŒã·ã§ã³ã®éçºãŸã§ãå¹ åºãå 容ãæäŸãããŠããŸãã
ç¹ã«ã“Rubyã®é”ã“Rubyããã°ã©ãã³ã°å ¥é”ãªã©ã®æžç±ã¯ãåå¿è ããäžçŽè ãŸã§ã®åŠç¿è ã«ããããã§ãããããã®æžç±ã¯ããããããã説æãè±å¯ãªäŸé¡ãæäŸããŠãããå¹æçãªåŠç¿ããµããŒãããŸãã
ãŸãããªã³ã©ã€ã³ã³ãã¥ããã£ã¯ãåŠç¿äžã®çåããã©ãã«ã解決ããããã®è²ŽéãªãªãœãŒã¹ã§ããäŸãã°ãRubyã³ãã¥ããã£ãRubyãã©ãŒã©ã ã§ã¯ãçµéšè±å¯ãªéçºè ãä»ã®åŠç¿è ããã®ãµããŒããã¢ããã€ã¹ãåããããšãã§ããŸãã
6.2 å®è·µçãªãããžã§ã¯ãããã¥ãŒããªã¢ã«
Rubyã®åŠç¿ãé²ããäžã§ãå®è·µçãªãããžã§ã¯ãããã¥ãŒããªã¢ã«ã¯éåžžã«æå¹ã§ãããããã®ãªãœãŒã¹ã掻çšããããšã§ãå®éã®éçºã®æµãããã¹ããã©ã¯ãã£ã¹ãåŠã¶ããšãã§ããŸãã
äŸãã°ã“Ruby on Railsã®Webã¢ããªã±ãŒã·ã§ã³éçºãã¥ãŒããªã¢ã«”ã“Rubyã§ã®ããŒã¿ããŒã¹æäœã®å®è·µã¬ã€ã”ãªã©ã®ãã¥ãŒããªã¢ã«ã¯ãå®éã®ã³ãŒããæžããªããåŠç¿ãé²ããããšãã§ããç解ãæ·±ããã®ã«åœ¹ç«ã¡ãŸãã
ãŸããå®è·µçãªãããžã§ã¯ããäœæããããšã§ãRubyã®ç¥èãã¹ãã«ãå®éã®éçºç°å¢ã§æŽ»çšããããšãã§ããŸããäŸãã°ãç°¡åãªWebã¢ããªã±ãŒã·ã§ã³ãããŒã«ãäœæããããšã§ãRubyã®åŒ·åãªæ©èœãã©ã€ãã©ãªã掻çšããæ¹æ³ãåŠã¶ããšãã§ããŸãã
以äžã®ããã«ãRubyã®åŠç¿ããµããŒãããè¿œå ã®ãªãœãŒã¹ã¯å€å²ã«ããããŸãããããã®ãªãœãŒã¹ã掻çšããããšã§ãå¹æçãªåŠç¿ãšã¹ãã«ã®åäžãå®çŸããããšãã§ããŸãã
7. ãŸãšããšæ¬¡ã®ã¹ããã
ãã®èšäºãéããŠãRubyã®åŠç¿ã«é¢ããå€å²ã«ãããæ å ±ããªãœãŒã¹ãæäŸããŸãããåŠç¿ã®æ ã¯çµããããªããåžžã«æ°ããç¥èãã¹ãã«ãè¿œæ±ããéçšã§ãããã®ã»ã¯ã·ã§ã³ã§ã¯ããããŸã§ã®åŠç¿ã®æ¯ãè¿ããšãä»åŸã®åŠç¿ã®é²ãæ¹ã«ã€ããŠèå¯ããŸãã
7.1 RubyåŠç¿ã®æ ã®æ¯ãè¿ã
Rubyã¯ãã·ã³ãã«ã§äººéäžå¿ã®ãã¶ã€ã³ãæã€ããã°ã©ãã³ã°èšèªãšããŠãå€ãã®éçºè ã«æãããŠããŸãããã®ç¹åŸŽãæŽå²ãåŠç¿ã®éèŠæ§ãåºæ¬çãªææ³ãæ§é ãããããã®åŠç¿ãµã€ããåŠç¿ã®ã³ããå¹æçãªé²ãæ¹ãããã«ã¯è¿œå ã®ãªãœãŒã¹ãªã©ãå€å²ã«ãããå 容ãåŠã³ãŸããã
ãã®åŠç¿ã®éçšã§ãç¶ç¶çãªåŠç¿ã®éèŠæ§ããå®è·µãåãå ¥ããåŠç¿æ¹æ³ã®å¹æãå®æããããšã§ãããããŸãããã©ãã«ããšã©ãŒã«çŽé¢ããéã«ããããä¹ãè¶ããçµéšãéããŠãæ·±ãç解ãæ°ããç¥èãåŸãããšãã§ããŸããã
7.2 ä»åŸã®åŠç¿ã®é²ãæ¹ãšç®æšèšå®
ããããã®Rubyã®åŠç¿ã®é²ãæ¹ã«ã€ããŠèããéãç®æšèšå®ã¯éåžžã«éèŠã§ããå ·äœçãªç®æšãæã€ããšã§ãåŠç¿ã®æ¹åæ§ãæ確ã«ããã¢ãããŒã·ã§ã³ãç¶æããããšãã§ããŸãã
äŸãã°ãWebã¢ããªã±ãŒã·ã§ã³ã®éçºãããŒã¿ããŒã¹ã®æäœãªã©ãç¹å®ã®ã¹ãã«ãç¥èãç¿åŸããããšãç®æšãšããããšãã§ããŸãããŸããå®éã®ãããžã§ã¯ããäœæããããšã§ãåŠç¿ããå 容ãå®è·µçã«æŽ»çšããããšãã§ããŸãã
æåŸã«ãåŠç¿ã¯äžäººã§é²ãããã®ã§ã¯ãããŸããããªã³ã©ã€ã³ã®ã³ãã¥ããã£ããã©ãŒã©ã ã掻çšããããšã§ãä»ã®åŠç¿è ãçµéšè±å¯ãªéçºè ããã®ãµããŒããã¢ããã€ã¹ãåããããšãã§ããŸãããã®ãããªãªãœãŒã¹ã掻çšããããšã§ãå¹æçãªåŠç¿ãšã¹ãã«ã®åäžãå®çŸããããšãã§ããŸãã
ãã®èšäºãèªãã ããªãããRubyã®åŠç¿ãç¶ç¶ãããããªãã¹ãã«ãç¥èãç¿åŸããããšãå¿ããå¿æŽããŠããŸãã