230件ヒット
[1-100件を表示]
(0.126秒)
別のキーワード
クラス
- Array (48)
-
Encoding
:: Converter (48) - Enumerator (12)
- Exception (12)
-
JSON
:: State (12) - MatchData (50)
- OptionParser (12)
- Random (36)
キーワード
- [] (36)
- accept (12)
-
backtrace
_ locations (12) - bytebegin (2)
-
check
_ circular? (12) - end (12)
- next (12)
- offset (24)
-
primitive
_ convert (48) - rand (36)
検索結果
先頭5件
-
MatchData
# begin(n) -> Integer | nil (24250.0) -
n 番目の部分文字列先頭のオフセットを返します。
...ram 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) # => `begin......': index 4 out of matches (IndexError)
//}
@see MatchData#end... -
Array
# at(nth) -> object | nil (18123.0) -
nth 番目の要素を返します。nth 番目の要素が存在しない時には nil を返します。
...nth 番目の要素を返します。nth 番目の要素が存在しない時には nil を返します。
@param nth インデックスを整数で指定します。
先頭の要素が 0 番目になります。nth の値が負の時には末尾から
のインデックス......ドによる
暗黙の型変換を試みます。
@raise TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。
//emlist[例][ruby]{
a = [ "a", "b", "c", "d", "e" ]
a[0] #=> "a"
a[1] #=> "b"
a... -
Exception
# backtrace _ locations -> [Thread :: Backtrace :: Location] (12419.0) -
バックトレース情報を返します。Exception#backtraceに似ていますが、 Thread::Backtrace::Location の配列を返す点が異なります。
...#backtraceに似ていますが、
Thread::Backtrace::Location の配列を返す点が異なります。
現状では Exception#set_backtrace によって戻り値が変化する事はあり
ません。
//emlist[例: test.rb][ruby]{
require "date"
def check_long_month(month)
return if Date.new......1
raise "#{month} is not long month"
end
def get_exception
return begin
yield
rescue => e
e
end
end
e = get_exception { check_long_month(2) }
p e.backtrace_locations
# => ["test.rb:4:in `check_long_month'", "test.rb:15:in `block in <main>'", "test.rb:9:in `get_exception'", "test.rb......:15:in `<main>'"]
//}
@see Exception#backtrace... -
MatchData
# bytebegin(n) -> Integer | nil (12261.0) -
n 番目の部分文字列先頭のバイトオフセットを返します。
...フセットを返します。
@param n 部分文字列を指定する数値。
@param name 名前付きキャプチャを指定する文字列またはシンボル。
@raise IndexError 範囲外の n を指定した場合に発生します。
@raise IndexError 正規表現中で定義されてい......st[例][ruby]{
/(c).*(いう).*(e.*)/ =~ 'abcあいうdef'
p $~ # => #<MatchData "cあいうdef" 1:"c" 2:"いう" 3:"ef">
p $~.bytebegin(0) # => 2
p $~.bytebegin(1) # => 2
p $~.bytebegin(2) # => 6
p $~.bytebegin(3) # => 13
p $~.bytebegin(4) # => index 4 out of matches (IndexError)
//}......t[シンボルを指定する例][ruby]{
/(?<key>\S+):\s*(?<value>\S+)/ =~ "name: ruby"
$~ # => #<MatchData "name: ruby" key:"name" value:"ruby">
$~.bytebegin(:key) # => 0
$~.bytebegin(:value) # => 6
$~.bytebegin(:foo) # => undefined group name reference: foo (IndexError)
//}... -
MatchData
# bytebegin(name) -> Integer | nil (12261.0) -
n 番目の部分文字列先頭のバイトオフセットを返します。
...フセットを返します。
@param n 部分文字列を指定する数値。
@param name 名前付きキャプチャを指定する文字列またはシンボル。
@raise IndexError 範囲外の n を指定した場合に発生します。
@raise IndexError 正規表現中で定義されてい......st[例][ruby]{
/(c).*(いう).*(e.*)/ =~ 'abcあいうdef'
p $~ # => #<MatchData "cあいうdef" 1:"c" 2:"いう" 3:"ef">
p $~.bytebegin(0) # => 2
p $~.bytebegin(1) # => 2
p $~.bytebegin(2) # => 6
p $~.bytebegin(3) # => 13
p $~.bytebegin(4) # => index 4 out of matches (IndexError)
//}......t[シンボルを指定する例][ruby]{
/(?<key>\S+):\s*(?<value>\S+)/ =~ "name: ruby"
$~ # => #<MatchData "name: ruby" key:"name" value:"ruby">
$~.bytebegin(:key) # => 0
$~.bytebegin(:value) # => 6
$~.bytebegin(:foo) # => undefined group name reference: foo (IndexError)
//}... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize) -> Symbol (9419.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...oding::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize......aram options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after......t before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize , options) -> Symbol (9419.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...oding::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize......aram options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after......t before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty... -
Random
# rand(range) -> Integer | Float (9349.0) -
一様な擬似乱数を発生させます。
...ることは出来ません。
三番目の形式では range で指定された範囲の値を返します。
range の始端と終端が共に整数の場合は整数を、少なくとも片方が実数の場合は実数を返します。
rangeが終端を含まない(つまり ... で生成し......れます。
range.end - range.begin が整数を返す場合は range.begin + self.rand((range.end - range.begin) + e)
の値を返します(e は終端を含む場合は1、含まない場合は0です)。
range.end - range.begin が実数を返す場合も同様です。
このため range が Ti......。
@param max 乱数値の上限を正の整数または実数で指定します。
max 自体は乱数値の範囲に含まれません。
@param range 発生させる乱数値の範囲を Range オブジェクトで指定します。
range.end - range.begin は数値... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset) -> Symbol (9319.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...oding::Converter#primitive_convert が唯一の方法になります。
@param source_buffer 変換元文字列のバッファ
@param destination_buffer 変換先文字列を格納するバッファ
@param destination_byteoffset 変換先バッファでのオフセット
@param destination_bytesize......aram options 変換の詳細を指定する定数やハッシュ
@return 変換結果を表す Symbol
options には以下が指定できます。
: hash form
:partial_input => true # source buffer may be part of larger source
:after_output => true # stop conversion after......t before input
: integer form
Encoding::Converter::PARTIAL_INPUT
Encoding::Converter::AFTER_OUTPUT
戻り値は以下のうちのどれかです。
* :invalid_byte_sequence
* :incomplete_input
* :undefined_conversion
* :after_output
* :destination_buffer_full
* :source_buffer_empty... -
Random
# rand -> Float (9249.0) -
一様な擬似乱数を発生させます。
...ることは出来ません。
三番目の形式では range で指定された範囲の値を返します。
range の始端と終端が共に整数の場合は整数を、少なくとも片方が実数の場合は実数を返します。
rangeが終端を含まない(つまり ... で生成し......れます。
range.end - range.begin が整数を返す場合は range.begin + self.rand((range.end - range.begin) + e)
の値を返します(e は終端を含む場合は1、含まない場合は0です)。
range.end - range.begin が実数を返す場合も同様です。
このため range が Ti......。
@param max 乱数値の上限を正の整数または実数で指定します。
max 自体は乱数値の範囲に含まれません。
@param range 発生させる乱数値の範囲を Range オブジェクトで指定します。
range.end - range.begin は数値... -
Random
# rand(max) -> Integer | Float (9249.0) -
一様な擬似乱数を発生させます。
...ることは出来ません。
三番目の形式では range で指定された範囲の値を返します。
range の始端と終端が共に整数の場合は整数を、少なくとも片方が実数の場合は実数を返します。
rangeが終端を含まない(つまり ... で生成し......れます。
range.end - range.begin が整数を返す場合は range.begin + self.rand((range.end - range.begin) + e)
の値を返します(e は終端を含む場合は1、含まない場合は0です)。
range.end - range.begin が実数を返す場合も同様です。
このため range が Ti......。
@param max 乱数値の上限を正の整数または実数で指定します。
max 自体は乱数値の範囲に含まれません。
@param range 発生させる乱数値の範囲を Range オブジェクトで指定します。
range.end - range.begin は数値...