1411件ヒット
[1-100件を表示]
(0.140秒)
別のキーワード
ライブラリ
- ビルトイン (889)
-
json
/ add / exception (12) -
net
/ http (60) - openssl (12)
- optparse (24)
- shell (18)
-
shell
/ command-processor (18) -
shell
/ filter (18) - socket (36)
- strscan (60)
- thread (12)
- zlib (252)
クラス
- Array (36)
- BasicSocket (12)
-
Encoding
:: Converter (48) -
Encoding
:: InvalidByteSequenceError (24) - Exception (140)
- FrozenError (6)
- KeyError (16)
- LoadError (12)
- LocalJumpError (24)
- MatchData (48)
- Module (12)
- NameError (44)
-
Net
:: HTTPResponse (12) - NoMethodError (12)
- Object (12)
-
OpenSSL
:: SSL :: SSLContext (12) - OptionParser (24)
- Range (50)
- Regexp (24)
- Shell (18)
-
Shell
:: CommandProcessor (18) -
Shell
:: Filter (18) - SignalException (24)
- StopIteration (12)
- String (144)
- StringScanner (60)
- SystemCallError (12)
- SystemExit (24)
- Thread (60)
-
Thread
:: Queue (36) -
Thread
:: SizedQueue (36) - TracePoint (12)
- UDPSocket (12)
- UNIXServer (12)
- UncaughtThrowError (33)
-
Zlib
:: GzipReader (216) -
Zlib
:: GzipWriter (24) -
Zlib
:: Inflate (12)
モジュール
- Comparable (12)
-
Net
:: HTTPExceptions (12) -
Net
:: HTTPHeader (36)
キーワード
- == (12)
- =~ (12)
- [] (102)
- accept (12)
-
accept
_ nonblock (12) - args (12)
- backtrace (12)
-
backtrace
_ locations (12) -
ca
_ file= (12) - cause (12)
- clamp (12)
- close (12)
- cover? (14)
- deq (24)
- each (24)
-
each
_ byte (24) -
each
_ line (24) - end (12)
- eof (12)
- eof? (12)
- errno (12)
-
error
_ bytes (12) - exception (24)
- exit (12)
-
exit
_ value (12) - fetch (72)
- finish (12)
- first (24)
-
fixed
_ encoding? (12) - getc (12)
- getpeereid (12)
- gets (12)
-
incomplete
_ input? (12) -
initialize
_ copy (12) - inspect (12)
- key (8)
- kill (12)
- lineno (12)
- lineno= (12)
-
local
_ variables (10) - mkdir (18)
- name (12)
- offset (24)
- path (12)
- peek (12)
- peep (12)
- pointer= (12)
- pop (24)
- pos= (12)
-
primitive
_ convert (48) -
public
_ constant (12) - raise (12)
-
raised
_ exception (12) - read (12)
- readchar (12)
- readline (12)
- readlines (12)
- reason (12)
- receiver (24)
-
recvfrom
_ nonblock (12) - reject (12)
- response (12)
- result (12)
- rewind (12)
-
set
_ backtrace (12) -
set
_ dictionary (12) - shift (24)
- signm (12)
- signo (12)
- slice (72)
- status (12)
- success? (12)
- tag (11)
- terminate (12)
- test (18)
-
to
_ json (12) -
to
_ s (35) - ungetc (12)
- unscan (12)
- value (23)
検索結果
先頭5件
-
Range
# begin -> object (18172.0) -
始端の要素を返します。 始端を持たない範囲オブジェクトの場合、begin はnilを返しますが, first は例外 RangeError が発生します。
...トの場合、begin はnilを返しますが, first は例外 RangeError が発生します。
//emlist[例][ruby]{
# 始端を持つ場合
p (1..5).begin # => 1
p (1..0).begin # => 1
p (1..5).first # => 1
p (1..0).first # => 1
# 始端を持たない場合
p (..5).begin #=> nil
p (..5).first #=>... -
MatchData
# begin(n) -> Integer | nil (18168.0) -
n 番目の部分文字列先頭のオフセットを返します。
...。
@param n 部分文字列を指定する数値。
@raise IndexError 範囲外の n を指定した場合に発生します。
//emlist[例][ruby]{
/(foo)(bar)(BAZ)?/ =~ "foobarbaz"
p $~.begin(0) # => 0
p $~.begin(1) # => 0
p $~.begin(2) # => 3
p $~.begin(3) # => nil
p $~.begin(4) # =... -
Exception
# exception(error _ message) -> Exception (9207.0) -
引数を指定しない場合は self を返します。引数を指定した場合 自身のコピー を生成し Exception#message 属性を error_message にして返します。
...Exception#message 属性を error_message にして返します。
Kernel.#raise は、実質的に、例外オブジェクトの exception
メソッドの呼び出しです。
@param error_message エラーメッセージを表す文字列を指定します。
//emlist[例][ruby]{
begin
# .........# 何か処理
rescue => e
raise e.exception("an error occurs during hogehoge process") # 詳しいエラーメッセージ
end
//}... -
OptionParser
# accept(klass , pat = / . * / ) {|str| . . . } -> () (9113.0) -
OptionParser.accept と同様ですが、 登録したブロックはレシーバーに限定されます。
...OptionParser.accept と同様ですが、
登録したブロックはレシーバーに限定されます。
@param klass クラスオブジェクトを与えます。
@param pat match メソッドを持ったオブジェクト(Regexp オブジェクトなど)を与えます。
//emlist[例][rub......y]{
require "optparse"
require "time"
opts = OptionParser.new
opts.accept(Time) do |s,|
begin
Time.parse(s) if s
rescue
raise OptionParser::InvalidArgument, s
end
end
opts.on("-t", "--time [TIME]", Time) do |time|
p time.class # => Time
end
opts.parse!(ARGV)
//}... -
Exception
# exception -> self (9107.0) -
引数を指定しない場合は self を返します。引数を指定した場合 自身のコピー を生成し Exception#message 属性を error_message にして返します。
...Exception#message 属性を error_message にして返します。
Kernel.#raise は、実質的に、例外オブジェクトの exception
メソッドの呼び出しです。
@param error_message エラーメッセージを表す文字列を指定します。
//emlist[例][ruby]{
begin
# .........# 何か処理
rescue => e
raise e.exception("an error occurs during hogehoge process") # 詳しいエラーメッセージ
end
//}... -
Net
:: HTTPExceptions # response -> Net :: HTTPResponse (6207.0) -
例外の原因となったレスポンスオブジェクトを返します。
...レスポンスオブジェクトを返します。
//emlist[例][ruby]{
require 'net/http'
uri = "http://www.example.com/invalid.html"
response = Net::HTTP.get_response(URI.parse(uri))
begin
response.value
rescue => e
e.response # => #<Net::HTTPNotFound 404 Not Found readbody=true>
end
//}... -
TracePoint
# raised _ exception -> Exception (6207.0) -
発生した例外を返します。
...eError :raise イベントのためのイベントフックの外側で実行し
た場合に発生します。
//emlist[例][ruby]{
trace = TracePoint.new(:raise) do |tp|
tp.raised_exception # => #<ZeroDivisionError: divided by 0>
end
trace.enable
begin
0/0
rescue
end
//}... -
StringScanner
# peek(bytes) -> String (6179.0) -
スキャンポインタから長さ bytes バイト分だけ文字列を返します。
...test string')
s.peek(4) # => "test"
//}
また、このメソッドを実行してもスキャンポインタは移動しません。
StringScanner#peep は将来のバージョンでは削除される予定です。
代わりに StringScanner#peek を使ってください。
@param bytes 0 以......st string')
p s.peek(4) # => "test"
p s.peek(20) # => "test string"
p s.peek(0) # => ""
begin
s.peek(-1)
rescue ArgumentError => err
puts err # negative string size (or size too big)
end
p s.scan(/\w+/) # => "test"
p s.scan(/\s+/) # => " "
p s.scan(/\w+/) # => "string"
p s.peek(4)......# => ""
# このメソッドを実行してもスキャンポインタは移動しません。
s = StringScanner.new('test string')
p s.peek(4) # => "test"
p s.peek(4) # => "test"
p s.scan(/\w+/) # => "test"
p s.peek(4) # => " str"
p s.peek(4) # => " str"
//}... -
StringScanner
# peep(bytes) -> String (6179.0) -
スキャンポインタから長さ bytes バイト分だけ文字列を返します。
...test string')
s.peek(4) # => "test"
//}
また、このメソッドを実行してもスキャンポインタは移動しません。
StringScanner#peep は将来のバージョンでは削除される予定です。
代わりに StringScanner#peek を使ってください。
@param bytes 0 以......st string')
p s.peek(4) # => "test"
p s.peek(20) # => "test string"
p s.peek(0) # => ""
begin
s.peek(-1)
rescue ArgumentError => err
puts err # negative string size (or size too big)
end
p s.scan(/\w+/) # => "test"
p s.scan(/\s+/) # => " "
p s.scan(/\w+/) # => "string"
p s.peek(4)......# => ""
# このメソッドを実行してもスキャンポインタは移動しません。
s = StringScanner.new('test string')
p s.peek(4) # => "test"
p s.peek(4) # => "test"
p s.scan(/\w+/) # => "test"
p s.peek(4) # => " str"
p s.peek(4) # => " str"
//}...