るりまサーチ

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

別のキーワード

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

ライブラリ

キーワード

検索結果

<< 1 2 3 ... > >>

Rational#to_s -> String (21238.0)

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

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

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

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

@
see Rational#inspect...

Range#to_s -> String (21236.0)

self を文字列に変換します(始端と終端のオブジェクトは #to_s メソッドで文 字列に変換されます)。

...self を文字列に変換します(始端と終端のオブジェクトは #to_s メソッドで文
字列に変換されます)。

@
see Range#inspect

//emlist[例][ruby]{
(1..5).to_s # => "1..5"
("1".."5").to_s # => "1..5"
//}...

Regexp#to_s -> String (21220.0)

正規表現の文字列表現を生成して返します。返される文字列は他の正規表 現に埋め込んでもその意味が保持されるようになっています。

...現に埋め込んでもその意味が保持されるようになっています。

//emlist[][ruby]{
r
e = /foo|bar|baz/i
p re.to_s # => "(?i-mx:foo|bar|baz)"
p /#{re}+/o # => /(?i-mx:foo|bar|baz)+/
//}

ただし、後方参照を含む正規表現は意図通りにはならない場合...
...//emlist[][ruby]{
r
e = /(foo|bar)\1/ # \1 は、foo か bar
p /(baz)#{re}/ # \1 は、baz

# => /(baz)(?-mix:(foo|bar)\1)/
//}

//emlist[使用例][ruby]{
r
e = /foo|bar|baz/i
p re.to_s # => "(?i-mx:foo|bar|baz)"
p /#{re}+/o # => /(?i-mx:foo|bar|baz)+/
//}

@
see Regexp#inspec...

IPAddr#to_s -> String (21214.0)

文字列に変換します。

...文字列に変換します。

r
equire 'ipaddr'
addr6 = IPAddr.new('::1')
addr6.to_s #=> "::1"
addr6.to_string #=> "0000:0000:0000:0000:0000:0000:0000:0001"

@
see IPAddr#to_string...

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

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

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

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

//emlist[][ruby]{
r
equire '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"
//}...

絞り込み条件を変える

REXML::Entity#to_s -> String (21214.0)

実体宣言を文字列化したものを返します。

...実体宣言を文字列化したものを返します。

@
see REXML::Entity#write

//emlist[][ruby]{
e = REXML::ENTITY.new("w", "wee");
p e.to_s # => "<!ENTITY w \"wee\">"
//}...

REXML::Text#to_s -> String (21214.0)

テキストの内容を正規化(すべての実体をエスケープ)された状態で返します。

...トとして妥当です。

結果は REXML::Text.new で指定した entity_filter を反映しています。

@
see REXML::Text#value

//emlist[][ruby]{
r
equire 'rexml/document'
t = REXML::Text.new("< & foobar", false, nil, false)
t.to_s # => "&lt; &amp; foobar"
t.value # => "< & foobar"
//}...

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

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

...を Kernel.#caller と同じ表現にした文字列を返し
ます。

//emlist[例][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>'
//}...

Fiddle::Pointer#to_s -> String (21209.0)

自身が指す領域から長さ len の文字列を複製して返します。

...自身が指す領域から長さ len の文字列を複製して返します。

len を省略した場合は、文字列の終りは '\0' であると仮定して、
strlen(3) を使って長さを算出します。

@
param len 文字列の長さを整数で指定します。...
<< 1 2 3 ... > >>