るりまサーチ

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

別のキーワード

  1. _builtin path
  2. pathname to_path
  3. _builtin absolute_path
  4. _builtin to_path
  5. csv path

ライブラリ

クラス

オブジェクト

キーワード

検索結果

<< 1 2 3 ... > >>

pathname (26000.0)

パス名をオブジェクト指向らしく扱うためのライブラリです。

パス名をオブジェクト指向らしく扱うためのライブラリです。

File.path(filename) -> String (18177.0)

指定されたファイル名を文字列で返します。filename が文字列でない場合は、to_path メソッドを呼びます。

...は、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") # => "/dev/null"
File.path(Pathname("/tmp")) # => "/tmp"
File.path(MyPath.new(".")) # => "/Users/user/projects/txt"
//}...

URI::Generic#path -> String | nil (18147.0)

自身の path を文字列で返します。設定されていない場合は nil を返します。

...自身の path を文字列で返します。設定されていない場合は nil を返します。

require 'uri'
p URI.parse('http://example.com/hoge').path #=> "/hoge"
p URI.parse('http://example.com').path #=> ""
p URI.parse('mailto:nospam@localhost').path #=> n...
...il
p URI('ftp://example.com/foo').path #=> 'foo'
p URI('ftp://example.com/%2Ffoo').path #=> '/foo'...

IO#path -> String | nil (18126.0)

IO に関連付けられたパスを返します。IO がパスに関連付けられていない場合は nil を返します。

...が返すパスがファイルシステム上に存在することは保証されていません。

//emlist[例][ruby]{
p STDIN.path # => "<STDIN>"
p IO.new(IO.sysopen("/")).path # => "/"
p IO.new(IO.sysopen("/"), path: "foo").path # => "foo"
//}...

CSV#path -> String (18123.0)

IO#path に委譲します。

...IO#path に委譲します。


@see IO#path...

絞り込み条件を変える

Net::HTTPGenericRequest#path -> String (18123.0)

リクエストする path を文字列で返します。

...リクエストする path を文字列で返します。

//emlist[例][ruby]{
require 'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.path # => "/index.html"
//}...

File#path -> String (18120.0)

オープン時に使用したパスを文字列で返します。

...作成されていたりする場合です。

//emlist[例][ruby]{
File.open("testfile") {|f| f.path } #=> "testfile"
File.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/../tmp/xxx"
File.open("/tmp", File::RDWR | File::TMPFILE){|f| f.path } #=> "/tmp"
//}...
...発生します。

//emlist[例][ruby]{
File.open("testfile") {|f| f.path } #=> "testfile"
File.open("/tmp/../tmp/xxx", "w") {|f| f.path } #=> "/tmp/../tmp/xxx"
File.open("/tmp", File::RDWR | File::TMPFILE){|f| f.path } # IOError: File is unnamed (TMPFILE?)
//}...

RubyVM::InstructionSequence#path -> String (18119.0)

self が表す命令シーケンスの相対パスを返します。

...ompiled>@<compiled>>
iseq.path
# => "<compiled>"

例2: RubyVM::InstructionSequence.compile_file を使用した場合

# /tmp/method.rb
def hello
puts "hello, world"
end

# irb
> iseq = RubyVM::InstructionSequence.compile_file('method.rb')
> iseq.path # => "method.rb"

@see Ruby...
...VM::InstructionSequence#absolute_path...

Zlib::GzipFile#path -> String (18117.0)

関連付けられている IO オブジェクトのパスを返します。 このメソッドは IO オブジェクトが path というメソッドを持つ場合のみ定義されます。

...関連付けられている IO オブジェクトのパスを返します。
このメソッドは IO オブジェクトが path というメソッドを持つ場合のみ定義されます。...

Dir#path -> String (18114.0)

オープンしているディレクトリのパス名を文字列で返します。

...オープンしているディレクトリのパス名を文字列で返します。

//emlist[例][ruby]{
Dir.open("..") do |d|
d.path # => ".."
d.to_path # => ".."
end
//}...

絞り込み条件を変える

<< 1 2 3 ... > >>