るりまサーチ

最速Rubyリファレンスマニュアル検索!
352件ヒット [1-100件を表示] (0.119秒)
トップページ > クエリ:i[x] > クエリ:length=[x]

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. matrix i
  5. ipaddr to_i

検索結果

<< 1 2 3 ... > >>

RSS::Maker::RSS20::Items::Item::Enclosure#length=() (21100.0)

@todo

@todo

RSS::Rss::Channel::Item::Enclosure#length= (18101.0)

@todo

@todo

JSON::State#buffer_initial_length=(length) (12200.0)

This sets the initial length of the buffer to length, if length > 0, otherwise its value isn't changed.

...This sets the initial length of the buffer to length, if length > 0,
otherwise its value isn't changed....

Array#fill(start, length = nil) {|index| ... } -> self (6226.0)

配列の指定された範囲すべてに val をセットします。

...域を nil で初期化します。
範囲の終点が自身の末尾を越える時は長さを自動的に拡張し、拡張した部分を val で初期化します。
このメソッドが val のコピーでなく val 自身をセットすることに注意してください。
//emlist[例][ru...
...by]{
a = [0, 1, 2]
a.fill("x", 5..10)
p a #=> [0, 1, 2, nil, nil, "x", "x", "x", "x", "x", "x"]
//}

val の代わりにブロックを指定するとブロックの評価結果を値とし
ます。ブロックは要素毎に実行されるので、セットする値のそれぞれをあ
るオブ...
...ンデックスが渡されます。

//emlist[例][ruby]{
ary = []
p ary.fill(1..2) {|i| i} # => [nil, 1, 2]
p ary.fill(0,3) {|i| i} # => [0, 1, 2]
p ary.fill { "foo" } # => ["foo", "foo", "foo"]
p ary.collect {|v| v.object_id } # => [537770124, 537770112, 537770100]
//...

Array#fill(val, start, length = nil) -> self (6226.0)

配列の指定された範囲すべてに val をセットします。

...域を nil で初期化します。
範囲の終点が自身の末尾を越える時は長さを自動的に拡張し、拡張した部分を val で初期化します。
このメソッドが val のコピーでなく val 自身をセットすることに注意してください。
//emlist[例][ru...
...by]{
a = [0, 1, 2]
a.fill("x", 5..10)
p a #=> [0, 1, 2, nil, nil, "x", "x", "x", "x", "x", "x"]
//}

val の代わりにブロックを指定するとブロックの評価結果を値とし
ます。ブロックは要素毎に実行されるので、セットする値のそれぞれをあ
るオブ...
...ンデックスが渡されます。

//emlist[例][ruby]{
ary = []
p ary.fill(1..2) {|i| i} # => [nil, 1, 2]
p ary.fill(0,3) {|i| i} # => [0, 1, 2]
p ary.fill { "foo" } # => ["foo", "foo", "foo"]
p ary.collect {|v| v.object_id } # => [537770124, 537770112, 537770100]
//...

絞り込み条件を変える

IO.binread(path, length = nil, offset = 0) -> String | nil (6201.0)

path で指定したファイルを open し、offset の所まで seek し、 length バイト読み込みます。

...SCII-8BIT" です。

//emlist[例][ruby]{
I
O.write("testfile", "This is line one\nThis is line two\nThis is line three\nAnd so on...\n")
I
O.binread("testfile") # => "This is line one\nThis is line two\nThis is line three\nAnd so on...\n"
I
O.binread("testfile", 20) # => "This is line...
...one\nThi"
I
O.binread("testfile", 20, 10) # => "ne one\nThis is line "
//}

@see IO.read...

Kernel.#caller_locations(range) -> [Thread::Backtrace::Location] | nil (6201.0)

現在のフレームを Thread::Backtrace::Location の配列で返します。引 数で指定した値が範囲外の場合は nil を返します。

...現在のフレームを Thread::Backtrace::Location の配列で返します。引
数で指定した値が範囲外の場合は nil を返します。

@param start 開始フレームの位置を数値で指定します。

@param length 取得するフレームの個数を指定します。

@pa...
...

//emlist[例][ruby]{
def test1(start, length)
locations = caller_locations(start, length)
p locations
p locations.map(&:lineno)
p locations.map(&:path)
end

def test2(start, length)
test1(start, length)
end

def test3(start, length)
test2(start, length)
end

caller_locations # => []...
...1, nil)
# => ["/Users/user/test.rb:9:in `test2'", "/Users/user/test.rb:13:in `test3'", "/Users/user/test.rb:17:in `<main>'"]
# => [9, 13, 17]
# => ["/Users/user/test.rb", "/Users/user/test.rb", "/Users/user/test.rb"]
test3(1, 2)
# => ["/Users/user/test.rb:9:in `test2'", "/Users/user/test.rb:13:in `t...

Kernel.#caller_locations(start = 1, length = nil) -> [Thread::Backtrace::Location] | nil (6201.0)

現在のフレームを Thread::Backtrace::Location の配列で返します。引 数で指定した値が範囲外の場合は nil を返します。

...現在のフレームを Thread::Backtrace::Location の配列で返します。引
数で指定した値が範囲外の場合は nil を返します。

@param start 開始フレームの位置を数値で指定します。

@param length 取得するフレームの個数を指定します。

@pa...
...

//emlist[例][ruby]{
def test1(start, length)
locations = caller_locations(start, length)
p locations
p locations.map(&:lineno)
p locations.map(&:path)
end

def test2(start, length)
test1(start, length)
end

def test3(start, length)
test2(start, length)
end

caller_locations # => []...
...1, nil)
# => ["/Users/user/test.rb:9:in `test2'", "/Users/user/test.rb:13:in `test3'", "/Users/user/test.rb:17:in `<main>'"]
# => [9, 13, 17]
# => ["/Users/user/test.rb", "/Users/user/test.rb", "/Users/user/test.rb"]
test3(1, 2)
# => ["/Users/user/test.rb:9:in `test2'", "/Users/user/test.rb:13:in `t...

Thread#backtrace_locations(range) -> [Thread::Backtrace::Location] | nil (6201.0)

スレッドの現在のバックトレースを Thread::Backtrace::Location の配 列で返します。

...スレッドの現在のバックトレースを Thread::Backtrace::Location の配
列で返します。

引数で指定した値が範囲外の場合、スレッドがすでに終了している場合は nil
を返します。

@param start 開始フレームの位置を数値で指定します...
...ernel.#caller_locations と似ていますが、本メソッドは self に限定
した情報を返します。

//emlist[例][ruby]{
thread = Thread.new { sleep 1 }
thread.run
thread.backtrace_locations # => ["/path/to/test.rb:1:in `sleep'", "/path/to/test.rb:1:in `block in <main>'"]
//}

@see Thr...
...ead::Backtrace::Location...

Thread#backtrace_locations(start = 0, length = nil) -> [Thread::Backtrace::Location] | nil (6201.0)

スレッドの現在のバックトレースを Thread::Backtrace::Location の配 列で返します。

...スレッドの現在のバックトレースを Thread::Backtrace::Location の配
列で返します。

引数で指定した値が範囲外の場合、スレッドがすでに終了している場合は nil
を返します。

@param start 開始フレームの位置を数値で指定します...
...ernel.#caller_locations と似ていますが、本メソッドは self に限定
した情報を返します。

//emlist[例][ruby]{
thread = Thread.new { sleep 1 }
thread.run
thread.backtrace_locations # => ["/path/to/test.rb:1:in `sleep'", "/path/to/test.rb:1:in `block in <main>'"]
//}

@see Thr...
...ead::Backtrace::Location...

絞り込み条件を変える

<< 1 2 3 ... > >>