るりまサーチ

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

別のキーワード

  1. _builtin >
  2. bigdecimal >
  3. float >
  4. integer >
  5. comparable >

ライブラリ

クラス

検索結果

Pathname#parent -> Pathname (21398.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:..>
//}...