るりまサーチ

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

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

検索結果

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