844件ヒット
[1-100件を表示]
(0.134秒)
ライブラリ
- ビルトイン (502)
-
json
/ add / exception (12) -
net
/ http (36) - openssl (12)
- optparse (24)
- shell (18)
-
shell
/ command-processor (18) -
shell
/ filter (18) - socket (12)
- strscan (48)
- thread (12)
- zlib (132)
クラス
- Array (36)
-
Encoding
:: Converter (48) - Exception (68)
- MatchData (48)
- Module (12)
-
OpenSSL
:: SSL :: SSLContext (12) - OptionParser (24)
- Range (50)
- Regexp (12)
- Shell (18)
-
Shell
:: CommandProcessor (18) -
Shell
:: Filter (18) - String (144)
- StringScanner (48)
- Thread (24)
-
Thread
:: Queue (36) -
Thread
:: SizedQueue (36) - UDPSocket (12)
-
Zlib
:: GzipReader (120) -
Zlib
:: Inflate (12)
モジュール
- Comparable (12)
-
Net
:: HTTPHeader (36)
キーワード
- == (12)
- =~ (12)
- [] (102)
- accept (12)
-
ca
_ file= (12) - clamp (12)
- cover? (14)
- deq (24)
- each (24)
-
each
_ line (24) - end (12)
- exception (24)
- fetch (72)
- first (24)
- gets (12)
- lineno= (12)
- mkdir (18)
- offset (24)
- peek (12)
- peep (12)
- pointer= (12)
- pop (24)
- pos= (12)
-
primitive
_ convert (48) -
public
_ constant (12) - raise (12)
- read (12)
- readline (12)
- readlines (12)
-
recvfrom
_ nonblock (12) - reject (12)
-
set
_ backtrace (12) -
set
_ dictionary (12) - shift (24)
- slice (72)
- test (18)
-
to
_ json (12) - ungetc (12)
検索結果
先頭5件
-
MatchData
# begin(n) -> Integer | nil (18174.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) # =... -
Range
# begin -> object (18173.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 #=>... -
Exception
# exception(error _ message) -> Exception (9213.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| . . . } -> () (9125.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 (9113.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
//}... -
StringScanner
# peek(bytes) -> String (6185.0) -
スキャンポインタから長さ bytes バイト分だけ文字列を返します。
...st 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 (6185.0) -
スキャンポインタから長さ bytes バイト分だけ文字列を返します。
...st 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
# pointer=(n) (6155.0) -
スキャンポインタのインデックスを n にセットします。
...スキャンポインタのインデックスを n にセットします。
@param n 整数で、バイト単位で指定します。
負数を指定すると文字列の末尾からのオフセットとして扱います。
@raise RangeError マッチ対象の文字列の長さを超え......tringScanner.new('test string')
p s.scan(/\w+/) # => "test"
p s.pos = 1 # => 1
p s.scan(/\w+/) # => "est"
p s.pos = 7 # => 7
p s.scan(/\w+/) # => "ring"
begin
s.pos = 20
rescue RangeError => err
puts err #=> index out of range
end
p s.pos = -4 # => -4
p s.scan(/\w+/) # => "ring"
//}... -
StringScanner
# pos=(n) (6155.0) -
スキャンポインタのインデックスを n にセットします。
...スキャンポインタのインデックスを n にセットします。
@param n 整数で、バイト単位で指定します。
負数を指定すると文字列の末尾からのオフセットとして扱います。
@raise RangeError マッチ対象の文字列の長さを超え......tringScanner.new('test string')
p s.scan(/\w+/) # => "test"
p s.pos = 1 # => 1
p s.scan(/\w+/) # => "est"
p s.pos = 7 # => 7
p s.scan(/\w+/) # => "ring"
begin
s.pos = 20
rescue RangeError => err
puts err #=> index out of range
end
p s.pos = -4 # => -4
p s.scan(/\w+/) # => "ring"
//}...