るりまサーチ (Ruby 3.2)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.145秒)
トップページ > クエリ:-[x] > クエリ:E[x] > ライブラリ:pathname[x] > バージョン:3.2[x] > クエリ:parent[x]

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method new
  4. irb/input-method gets
  5. matrix -

クラス

検索結果

Pathname#parent -> Pathname (73036.0)

self の親ディレクトリを指す新しい Pathname オブジェクトを返します。

...を指す新しい Pathname オブジェクトを返します。

//emlist[例 絶対パス][ruby]{
require "pathname"

path = Pathname("/usr")
path # => #<Pathname:/usr>
path.parent # => #<Pathname:/>
//}

//emlist[例 相対パス][ruby]{
require "pathname"

path = Pathname("foo/bar")
path....
...parent # => #<Pathname:foo>
path.parent.parent # => #<Pathname:.>
path.parent.parent.parent # => #<Pathname:..>
//}...