Jul 24 2013 TL;DR: Subclassing core classes in Ruby can lead to unexpected side effects. I suggest composition over inheritance in all these cases. Subclassing Review If youâre familiar with the concept of subclassing, skip down to âThe Problem.â In Ruby, you can make your own classes: class List end You can also make subclasses of those classes: class OrderedList < List end puts OrderedList.new.k
ããã³ã¾ãã¯ãRuby ã«é¢ããæè¡è¨äºã¯ãã¡ããã®ãã¨ãRubyist ã¸ã®ã¤ã³ã¿ãã¥ã¼ãã¨ãã»ã¤ããã®ä»ããå±ãããã¦ã§ãéèªã§ãã Rubyist Magazine ã«ã¤ã㦠ãRubyist Magazineããç¥ãã¦ããã³ã¾ãã¯ãRubyist ã® Rubyist ã«ãããRubyist ã¨ããã§ãªã人ã®ããã®ã¦ã§ãéèªã§ãã ææ°å· Rubyist Magazine 0064 å· ããã¯ãã³ãã¼ Rubyist Magazine 0064 å· Rubyist Magazine 0063 å· Rubyist Magazine 0062 å· Kaigi on Rails ç¹éå· RubyKaigi Takeout 2020 ç¹éå· Rubyist Magazine 0061 å· Rubyist Magazine 0060 å· RubyKaigi 2019 ç´åç¹éå· Rubyist
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}