ä»æ¥Rubyãæ¸ãã¦ãã¦ããªãããããã¨æã£ãåä½ããã£ãã 試ãã«ä»¥ä¸ã®ã³ã¼ããå®è¡ãã¦ã¿ã¦æ¬²ããã class Foo attr_reader :hoge, :fuga, def initialize(a, b) p a p b end end Foo.new å®è¡ãã¦ã¿ãã¨åããããããã«ã¯ä¾å¤ãåºãªãã initializeã§å®ç¾©ããå¿ é å¼æ°ã¯ã©ããªã£ãã®ãï¼ ããããè¦ãã¨attr_readerã®å¼æ°ã®æ«å°¾ã«,ãããã ã¤ã¾ãããã®ã³ã¼ãã¯åãããããæ¸ãã¨ä»¥ä¸ã®æ§ã«ãªãã class Foo attr_reader(:hoge, :fuga, def initialize(a, b) p a p b end) end Foo.new ãã®ã³ã¼ããæ´ã«åããæãæ¸ãã¨ãããªãã class Foo def initialize(a, b) p a p b end attr_rea
{{#tags}}- {{label}}
{{/tags}}