33件ヒット
[1-33件を表示]
(0.053秒)
検索結果
先頭3件
-
Net
:: SMTP # ready(from _ addr , *to _ addrs) {|f| . . . . } -> () (18220.0) -
メール書き込みの準備をし、書き込み先のストリームオブジェクトを ブロックに渡します。ブロック終了後、書きこんだ結果が 送られます。
...mple.com', 25) {|smtp|
smtp.open_message_stream('from@example.com', 'to@example.net') {|f|
f.puts 'From: from@example.com'
f.puts 'To: to@example.net'
f.puts 'Subject: test mail'
f.puts
f.puts 'This is test mail.'
}
}
ready は obsolete です。
@param from......TPエラーコード5xxの場合に発生します
@raise Net::SMTPAuthenticationError 送信に必要な認証を行っていなかった場合に発生します
@raise Net::SMTPUnknownError SMTPエラーコードがプロトコル上不正な場合に発生します
@see Net::SMTP#send_message... -
Net
:: SMTP # open _ message _ stream(from _ addr , *to _ addrs) {|f| . . . . } -> () (6220.0) -
メール書き込みの準備をし、書き込み先のストリームオブジェクトを ブロックに渡します。ブロック終了後、書きこんだ結果が 送られます。
...mple.com', 25) {|smtp|
smtp.open_message_stream('from@example.com', 'to@example.net') {|f|
f.puts 'From: from@example.com'
f.puts 'To: to@example.net'
f.puts 'Subject: test mail'
f.puts
f.puts 'This is test mail.'
}
}
ready は obsolete です。
@param from......TPエラーコード5xxの場合に発生します
@raise Net::SMTPAuthenticationError 送信に必要な認証を行っていなかった場合に発生します
@raise Net::SMTPUnknownError SMTPエラーコードがプロトコル上不正な場合に発生します
@see Net::SMTP#send_message... -
制御構造 (60.0)
-
制御構造 条件分岐: * if * unless * case 繰り返し: * while * until * for * break * next * redo * retry 例外処理: * raise * begin その他: * return * BEGIN * END
...eak により
while 式の戻り値をその値にすることもできます。
==== while 修飾子
//emlist[例][ruby]{
sleep(60) while io_not_ready?
//}
文法:
式 while 式
右辺の式を評価した値が真の間、左辺を繰り返し実行します。
左辺の式が begi......ます。
//emlist[][ruby]{
def iter
# (a)
# :
# (b)
yield
# (c)
# :
# (d)
end
iter { redo } # -> (b) へ飛ぶ
iter { next } # -> (c) へ飛ぶ
iter { break } # -> (d) へ飛ぶ
//}
(a) は、厳密には引数評価から始まります。(b) はブロック実行の直前......yntax")
raise # 最後の例外の再発生
//}
文法:
raise
raise messageまたはexception
raise error_type, message
raise error_type, message, traceback
例外を発生させます。第一の形式では直前の例外を再発生させま...