ããã°ãä¸è¨ã«ç§»è»¢ãã¾ããããã¶ã¤ã³å¤æ´ã«ãã移転å ã§ã¯è¨äºãä¸å±¤èªã¿ããããªã£ã¦ãã¾ãã®ã§ããããããã°ç§»åããé¡ãè´ãã¾ãã ç¥ã£ã¦å¾ãã21ã®Rubyã®ããªãã¢ãªè¨æ³: melborne.github.com - ã¡ãã£ã¨ããªãã¢ã ãã© ç¥ã£ã¦ããã¨æå¤ã¨ä¾¿å©ãªRubyã®è¨æ³ã 21åæ¾ã£ã¦ã¿ãã(Ruby1.9éå®) åãªãå ¨é¨ç¥ã£ã¦ããããããªããã©.. 1. åçç¶æ¿ Rubyã®ã¯ã©ã¹ç¶æ¿ã§ã¯ < è¨å·ã®å³è¾ºã« ã¯ã©ã¹å®æ°ã ãã§ãªãã¯ã©ã¹ãè¿ãå¼ãæ¸ããã class Male def laugh; 'Ha ha ha!' end end class Female def laugh; 'Fu fu fu..' end end class Me < [Male, Female][rand 2] end Me.superclass # => Female Me.new.laugh
{{#tags}}- {{label}}
{{/tags}}