ãRuby ã®ãããã¯ä»ãã¡ã½ããã¨ã¤ãã¬ã¼ã¿ - yield ã®æ§ã ãªä½¿ãæ¹ãã®ã¤ã¥ã 1. è¦ç´ ãä¿æãã親ã¯ã©ã¹ã¨ãè¦ç´ ã¨ãªãåã¯ã©ã¹ 次ã®ãããªä¾ãæ³å®ããã ã人ãããã°ã«ã¼ãã ã«æå±ãã¦ããã ã人ã㯠`åå' 㨠`å¹´é½¢' ãå±æ§ã¨ãã¦æã¤ã ãã°ã«ã¼ããã¯ã©ã¹ã¯è¦ªã¯ã©ã¹ã§ãã人ãã¯ã©ã¹ã¯è¦ç´ ã¨ãªãåã¯ã©ã¹ã class Person attr_reader :name , :age def initialize(name,age) @name = name @age = age end end 親ã¯ã©ã¹ã¨ãªããã°ã«ã¼ããã¯ãä¿æããã人ãã®éåã«å¯¾ãã¦è²¬åãæã£ã¦ãããã人ãããã°ã«ã¼ããã«è¿½å ããæä½ãæã¤ã¨ããã class Group def initialize @persons = [] end def add(person) @persons << pers
{{#tags}}- {{label}}
{{/tags}}