2021-06-29から1日間の記事一覧
行けたら行く的な。 結論 @person.non_existing_method if @person.respond_to?(:non_existing_method) # => nil は、 @person.try(:non_existing_method) # => nil と同じだと、https://api.rubyonrails.org/classes/Object.html#method-i-try にありました…
行けたら行く的な。 結論 @person.non_existing_method if @person.respond_to?(:non_existing_method) # => nil は、 @person.try(:non_existing_method) # => nil と同じだと、https://api.rubyonrails.org/classes/Object.html#method-i-try にありました…