るりまサーチ

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

別のキーワード

  1. _builtin at
  2. _builtin values_at
  3. time at
  4. dbm values_at
  5. sdbm values_at

ライブラリ

キーワード

検索結果

<< 1 2 3 ... > >>

MatchData#to_s -> String (24114.0)

マッチした文字列全体を返します。

...マッチした文字列全体を返します。

//emlist[例][ruby]{
/bar/ =~ "foobarbaz"
p $~ # => #<MatchData:0x401b1be4>
p $~.to_s # => "bar"
//}...

Rational#to_s -> String (21132.0)

自身を人間が読みやすい形の文字列表現にして返します。

..."-17/7" のように10進数の表記を返します。

@return 有理数の表記にした文字列を返します。

//emlist[例][ruby]{
Rational(3, 4).to_s # => "3/4"
Rational(8).to_s # => "8/1"
Rational(-8, 6).to_s # => "-4/3"
Rational(0.5).to_s # => "1/2"
//}

@see Rational#inspect...

Matrix#to_s -> String (21114.0)

行列を文字列化し、その文字列を返します。

...行列を文字列化し、その文字列を返します。

//emlist[例][ruby]{
require 'matrix'
a1 = [1, 2]
a2 = [3, 4.5]
m = Matrix[a1, a2]

p m.to_s # => "Matrix[[1, 2], [3, 4.5]]"
//}...

REXML::CData#to_s -> String (21114.0)

テキスト文字列を返します。

...テキスト文字列を返します。

@see REXML::Text#value, REXML::Text#to_s

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root><![CDATA[foobar baz]]></root>
EOS
doc.root[0].class # => REXML::CData
doc.root[0].value # => "foobar baz"
//}...

Rake::InvocationChain#to_s -> String (21114.0)

トップレベルのタスクから自身までの依存関係を文字列として返します。

...の依存関係を文字列として返します。

//emlist[][ruby]{
# Rakefile での記載例とする

task default: :test_rake_app
task :test_rake_app do
invocation_chain= Rake::InvocationChain.new("task_a", Rake::InvocationChain::EMPTY)
invocation_chain.to_s # => "TOP => task_a"
end
//}...

絞り込み条件を変える

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

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

...

//emlist[例][ruby]{
# foo.rb
class Foo
at
tr_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#to_s -> String (21108.0)

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

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


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

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

Float#to_s -> String (18144.0)

自身を人間が読みやすい形の文字列表現にして返します。

...列を返します。

//emlist[例][ruby]{
0.00001.to_s # => "1.0e-05"
3.14.to_s # => "3.14"
10000_00000_00000.0.to_s # => "100000000000000.0"
10000_00000_00000_00000.0.to_s # => "1.0e+19"
(1.0/0.0).to_s # => "Infinity"
(0.0/0.0).to_s # => "NaN"
//}...

Data#to_s -> String (18108.0)

self の内容を人間に読みやすい文字列にして返します。

...

//emlist[例][ruby]{
Customer = Data.define(:name, :address, :zip)
joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345)
joe.inspect # => "#<data Customer name=\"Joe Smith\", address=\"123 Maple, Anytown NC\", zip=12345>"
//}

[注意] 本メソッドの記述は Data のサブクラ...
...スのインスタンスに対して呼び
出す事を想定しています。Data.define は Data のサブクラスを作成する点に
注意してください。...

Pathname#expand_path(default_dir = &#39;.&#39;) -> Pathname (9223.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")
Pathname.pwd # => #<Pathname:/path/to>
path.expand_...
...path # => #<Pathname:/path/to/testfile>
path.expand_path("../") # => #<Pathname:/path/testfile>
//}

@see File.expand_path...

絞り込み条件を変える

<< 1 2 3 ... > >>