rubyãæ¸ãå§ãã¦éããªãé ã ããªã㧠NoMethodError ãªãã ...ãããã¡ã½ããå®ç¾©ã«self ä»ãããéã£ããã ã¿ãããªãã¨ãããã¾ããã rubyã®æ¬ãèªãã§ããã¨ããã®ããããããããªã¨ã¤ã¡ã¼ã¸ã§ããããã«ãªã£ãã®ã§ã¾ã¨ãã¦ããã¾ãã åèã«ããæ¬ å¹´æãããã²ãããRubyæ¬ãèªãã§ãã¾ããèªäºããã®ã¯ä»¥ä¸ã ç¾å¨ã¯ Effective Ruby ãèªãã§ãã¾ãã ããããèªãã§ããã¨ãä¸éå端ã«ç解ãã¦ããé¨åãã«ããã¨ãããã®ã§ãªã¹ã¹ã¡ã§ãã â» ä»åã®ã³ã¼ã㯠ruby 2.2.0 ã§è©¦ãããã®ã§ãã ãªãã¸ã§ã¯ãã¨ã¯ã©ã¹ã®é¢ä¿ ãµã³ãã«ã³ã¼ããè¦ã¦ã¿ã¾ãããã class C def c_instance_method @my_var = 1 end end obj = C.new å½åãèªåã¯ãªãã¸ã§ã¯ãã¨ã¯ã©ã¹ã®é¢ä¿ã以ä¸ã®ããã«èãã¦ãã¾ããã ï¼
{{#tags}}- {{label}}
{{/tags}}