3件ヒット
[1-3件を表示]
(0.290秒)
種類
- インスタンスメソッド (2)
- 特異メソッド (1)
検索結果
-
Dir
# to _ path -> String (69346.0) -
オープンしているディレクトリのパス名を文字列で返します。
オープンしているディレクトリのパス名を文字列で返します。
//emlist[例][ruby]{
Dir.open("..") do |d|
d.path # => ".."
d.to_path # => ".."
end
//} -
File
. path(filename) -> String (24145.0) -
指定されたファイル名を文字列で返します。filename が文字列でない場合は、to_path メソッドを呼びます。
指定されたファイル名を文字列で返します。filename が文字列でない場合は、to_path メソッドを呼びます。
@param filename ファイル名を表す文字列か to_path メソッドが定義されたオブジェクトを指定します。
//emlist[例][ruby]{
require 'pathname'
class MyPath
def initialize(path)
@path = path
end
def to_path
File.absolute_path(@path)
end
end
File.path("/dev/null") ... -
Dir
# path -> String (24046.0) -
オープンしているディレクトリのパス名を文字列で返します。
オープンしているディレクトリのパス名を文字列で返します。
//emlist[例][ruby]{
Dir.open("..") do |d|
d.path # => ".."
d.to_path # => ".."
end
//}