タグ

関連タグで絞り込む (1)

タグの絞り込みを解除

exception-handlingとminitukuに関するnabinnoのブックマーク (1)

  • Minituku - a Ruby e-learning system

    実際に実行した例が以下になります。 month = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] wrong_number = [0, 1, 2, 3, 4, 5, "6", "7", 8, 9, 10, 11] wrong_number.each do |num| begin puts month[num] rescue => ex puts ex.message break end end 後処理 例外が起こった場合と起こらない場合の両方で実行したい処理がある時はensureを使います。 begin <例外を発生させる可能性のある処理> rescue => <変数> <例外が起こった場合の処理> ensure <例外の有無に関わらず実行される処理> end 実際に

  • 1
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy