るりまサーチ

最速Rubyリファレンスマニュアル検索!
45件ヒット [1-45件を表示] (0.180秒)
トップページ > クエリ:I[x] > クエリ:Require[x] > クエリ:r[x] > クエリ:entries[x]

別のキーワード

  1. kernel require
  2. getoptlong require_order
  3. rubygems/custom_require require
  4. irb/ext/use-loader irb_require
  5. require execute

ライブラリ

クラス

モジュール

検索結果

Pathname#entries -> [Pathname] (30325.0)

self に含まれるファイルエントリ名を元にした Pathname オブジェクトの配列を返します。

...ます。

@raise Errno::EXXX self が存在しないパスであったりディレクトリでなければ例外が発生します。

//emlist[例][ruby]{
require
'pathname'
require
'pp'

pp Pathname('/usr/local').entries
# => [#<Pathname:.>,
# #<Pathname:..>,
# #<Pathname:bin>,
# #<Pa...
...thname:etc>,
# #<Pathname:include>,
# #<Pathname:lib>,
# #<Pathname:opt>,
# #<Pathname:sbin>,
# #<Pathname:share>,
# #<Pathname:var>]
//}

@see Dir.entries...

Enumerable#entries(*args) -> [object] (30313.0)

全ての要素を含む配列を返します。

...を返します。

@param args each の呼び出し時に引数として渡されます。

//emlist[例][ruby]{
(1..7).to_a #=> [1, 2, 3, 4, 5, 6, 7]
{ 'a'=>1, 'b'=>2, 'c'=>3 }.to_a #=> [["a", 1], ["b", 2], ["c", 3]]

require
'prime'
Prime.entries 10 #=> [2...

Range#entries -> Array (30307.0)

self を配列に変換します。

...

@raise RangeError 終端のない Range オブジェクトを変換しようとしたときに発生します。

//emlist[例][ruby]{
p (5..0).to_a # => []
p (0..3).to_a # => [0, 1, 2, 3]
p ('a'..'c').to_a # => ["a", "b", "c"]
p (:a..:d).to_a # => [:a, :b, :c, :d]

require
'date'
p...
...(Date.new(1965, 4, 14) .. Date.new(1965, 4, 14)).to_a # => [#<Date: 1965-04-14 ((2438865j,0s,0n),+0s,2299161j)>]

(1..).to_a # RangeError: cannot convert endless range to an array
//}...

Enumerable#to_a(*args) -> [object] (9113.0)

全ての要素を含む配列を返します。

...を返します。

@param args each の呼び出し時に引数として渡されます。

//emlist[例][ruby]{
(1..7).to_a #=> [1, 2, 3, 4, 5, 6, 7]
{ 'a'=>1, 'b'=>2, 'c'=>3 }.to_a #=> [["a", 1], ["b", 2], ["c", 3]]

require
'prime'
Prime.entries 10 #=> [2...

Range#to_a -> Array (9107.0)

self を配列に変換します。

...

@raise RangeError 終端のない Range オブジェクトを変換しようとしたときに発生します。

//emlist[例][ruby]{
p (5..0).to_a # => []
p (0..3).to_a # => [0, 1, 2, 3]
p ('a'..'c').to_a # => ["a", "b", "c"]
p (:a..:d).to_a # => [:a, :b, :c, :d]

require
'date'
p...
...(Date.new(1965, 4, 14) .. Date.new(1965, 4, 14)).to_a # => [#<Date: 1965-04-14 ((2438865j,0s,0n),+0s,2299161j)>]

(1..).to_a # RangeError: cannot convert endless range to an array
//}...

絞り込み条件を変える