るりまサーチ

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

別のキーワード

  1. _builtin >
  2. bigdecimal >
  3. float >
  4. complex >
  5. module >

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

URI::Generic#path -> String | nil (18248.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 #=> nil...
...p URI('ftp://example.com/foo').path #=> 'foo'
p URI('ftp://example.com/%2Ffoo').path #=> '/foo'...

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

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

...列から作成していた
場合は "<compiled>" を返します。

例1:irb で実行した場合

iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.path
# => "<compiled>"

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

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

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

@see RubyVM::InstructionSequence#absolute_path...

IO#path -> String | nil (18227.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 (18224.0)

IO#path に委譲します。

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


@see IO#path...

Net::HTTPGenericRequest#path -> String (18224.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 (18221.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?)
//}...

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

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

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

Dir#path -> String (18215.0)

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

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

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

Tempfile#path -> String | nil (18214.0)

テンポラリファイルのパス名を返します。

...テンポラリファイルのパス名を返します。

Tempfile#close! を実行後だった場合にはnilを返します。

require "tempfile"
tf = Tempfile.new("hoo")
p tf.path # => "/tmp/hoo.10596.0"
tf.close!
p tf.path # => nil...

Thread::Backtrace::Location#path -> String (18214.0)

self が表すフレームのファイル名を返します。

...self が表すフレームのファイル名を返します。

例: Thread::Backtrace::Location の例1を用いた例

//emlist[][ruby]{
loc = c(0..1).first
loc.path # => "caller_locations.rb"
//}

@see Thread::Backtrace::Location#absolute_path...

絞り込み条件を変える

<< 1 2 3 ... > >>