るりまサーチ

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

別のキーワード

  1. _builtin to_s
  2. openssl to_der
  3. openssl to_s
  4. _builtin to_a
  5. openssl to_pem

ライブラリ

キーワード

検索結果

<< 1 2 3 ... > >>

Pathname#to_s -> String (21113.0)

パス名を文字列で返します。

...パス名を文字列で返します。


//emlist[例][ruby]{
require 'pathname'

path
= Pathname.new("/tmp/hogehoge")
File.open(path)
//}...

Thread::Backtrace::Location#to_s -> String (18125.0)

self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し ます。

...mlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end

Foo.new(0..2).locations.map do |call|
puts call.to_s
end

# => path/to/foo.rb:5:in `initialize'
# path/to/foo.rb:9:in `new'
# path/to/foo.rb:9:in `<main>'
//}...

Pathname#expand_path(default_dir = &#39;.&#39;) -> Pathname (9287.0)

Pathname.new(File.expand_path(self.to_s, *args)) と同じです。

...Pathname.new(File.expand_path(self.to_s, *args)) と同じです。

@param default_dir self が相対パスであれば default_dir を基準に展開されます。

//emlist[例][ruby]{
require "pathname"

path
= Pathname("testfile")
Path
name.pwd # => #<Pathname:/path/to>
path
.expand_...
...path # => #<Pathname:/path/to/testfile>
path
.expand_path("../") # => #<Pathname:/path/testfile>
//}

@see File.expand_path...

Pathname#to_path -> String (9123.0)

File.open などの引数に渡す際に呼ばれるメソッドです。 Pathname オブジェ クトにおいては、 to_s と同じです。

...File.open などの引数に渡す際に呼ばれるメソッドです。 Pathname オブジェ
クトにおいては、 to_s と同じです。


@see Pathname#to_s...

Pathname#mkpath -> nil (9116.0)

FileUtils.mkpath(self.to_s) と同じです。

...FileUtils.mkpath(self.to_s) と同じです。


@see FileUtils.#mkpath...

絞り込み条件を変える

VALUE rb_class_path(VALUE klass) (6112.0)

klass の名前を返します.klassが無名クラス、無名モジュー ルの場合 #<Class 0xXXXX>, #<Module 0xXXXX> の形式で返します。

...klass の名前を返します.klassが無名クラス、無名モジュー
ルの場合 #<Class 0xXXXX>, #<Module 0xXXXX> の形式で返します。

Module#to_s の定義は

rb_str_dup(rb_class_path(klass));

です。...

Pathname#basename(suffix = "") -> Pathname (3116.0)

Pathname.new(File.basename(self.to_s, suffix)) と同じです。

...Pathname.new(File.basename(self.to_s, suffix)) と同じです。

@param suffix サフィックスを文字列で与えます。'.*' という文字列を与えた場合、'*' はワイルドカードとして働き
'.' を含まない任意の文字列にマッチします。

//emli...
...]{
require "pathname"

Path
name("ruby/ruby.c").basename #=> #<Pathname:"ruby.c">
Path
name("ruby/ruby.c").basename(".c") #=> #<Pathname:"ruby">
Path
name("ruby/ruby.c").basename(".*") #=> #<Pathname:"ruby">
Path
name("ruby/ruby.exe").basename(".*") #=> #<Pathname:"ruby">
Path
name("ruby/...
...y.tab.c").basename(".*") #=> #<Pathname:"y.tab">
//}

@see File.basename...

Pathname#dirname -> Pathname (3116.0)

Pathname.new(File.dirname(self.to_s)) と同じです。

...Pathname.new(File.dirname(self.to_s)) と同じです。

//emlist[例][ruby]{
require "pathname"

Path
name('/usr/bin/shutdown').dirname # => #<Pathname:/usr/bin>
//}

@see File.dirname...

Pathname#each_entry {|pathname| ... } -> nil (3116.0)

Dir.foreach(self.to_s) {|f| yield Pathname.new(f) } と同じです。

...each(self.to_s) {|f| yield Pathname.new(f) } と同じです。


//emlist[例][ruby]{
require "pathname"

Path
name("/usr/local").each_entry {|f| p f }

# => #<Pathname:.>
# => #<Pathname:..>
# => #<Pathname:bin>
# => #<Pathname:etc>
# => #<Pathname:include>
# => #<Pathname:lib>
# => #<Pathname:opt>...
...each(self.to_s) {|f| yield Pathname.new(f) } と同じです。

ブロックを省略した場合は Enumerator を返します。

//emlist[例][ruby]{
require "pathname"

Path
name("/usr/local").each_entry {|f| p f }

# => #<Pathname:.>
# => #<Pathname:..>
# => #<Pathname:bin>
# => #<Pathname:etc>...
...# => #<Pathname:include>
# => #<Pathname:lib>
# => #<Pathname:opt>
//}

@see Dir.foreach...

Pathname#readlink -> Pathname (3116.0)

Pathname.new(File.readlink(self.to_s)) と同じです。

...Pathname.new(File.readlink(self.to_s)) と同じです。


@see File.readlink...

絞り込み条件を変える

<< 1 2 3 ... > >>