るりまサーチ

最速Rubyリファレンスマニュアル検索!
22件ヒット [1-22件を表示] (0.090秒)

別のキーワード

  1. pathname ascend
  2. ascend pathname
  3. ascend enumerator

ライブラリ

クラス

検索結果

Pathname#ascend -> Enumerator (18115.0)

self のパス名から親方向に辿っていったときの各パス名を新しい Pathname オ ブジェクトとして生成し、ブロックへの引数として渡して実行します。 ブロックを省略した場合は Enumerator を返します。

...'pathname'

Pathname.new('/path/to/some/file.rb').ascend {|v| p v}
# => #<Pathname:/path/to/some/file.rb>
# #<Pathname:/path/to/some>
# #<Pathname:/path/to>
# #<Pathname:/path>
# #<Pathname:/>

Pathname.new('path/to/some/file.rb').ascend {|v| p v}
# => #<Pathname:path/to/some/file.rb>
#...

Pathname#ascend {|pathname| ... } -> nil (18115.0)

self のパス名から親方向に辿っていったときの各パス名を新しい Pathname オ ブジェクトとして生成し、ブロックへの引数として渡して実行します。 ブロックを省略した場合は Enumerator を返します。

...'pathname'

Pathname.new('/path/to/some/file.rb').ascend {|v| p v}
# => #<Pathname:/path/to/some/file.rb>
# #<Pathname:/path/to/some>
# #<Pathname:/path/to>
# #<Pathname:/path>
# #<Pathname:/>

Pathname.new('path/to/some/file.rb').ascend {|v| p v}
# => #<Pathname:path/to/some/file.rb>
#...