æ¦è¦ åèè ã®è¨±è«¾ãå¾ã¦ç¿»è¨³ã»å ¬éãããã¾ãã è±èªè¨äº: Safe navigation operator in Ruby åæå ¬éæ¥: 2017/11/17 èè : Akshay Mohite Rubyã®ã¼ã£ã¡æ¼ç®åã¯Railsã®Object#tryããé«éï¼ç¿»è¨³ï¼ &.ã¨ããsafe navigationæ¼ç®åï¼Nullæ¡ä»¶æ¼ç®å: Rubyã§ã¯ãã¼ã£ã¡æ¼ç®åãã¨ãå¼ã°ãã¾ãï¼ã¯Ruby 2.3ã§å°å ¥ããã¾ããããã®æ¼ç®åã¯ãnilãªãã¸ã§ã¯ãã«å¯¾ãã¦ã¡ã½ãããå¼ã³åºãããã¨ãã«nilãè¿ãã¾ãããã®æ¼ç®åããªãã£ãã¨ãã¯ãnilãªãã¸ã§ã¯ãã«å¯¾ãã¦å¼ã³åºããè¡ãã¨ä»¥ä¸ã®ããã«ã¨ã©ã¼ã«ãªãã¾ããã nil.some_method #=> NoMethodError: undefined method 'some_method' for nil:NilClass safe naviga
{{#tags}}- {{label}}
{{/tags}}