るりまサーチ

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

別のキーワード

  1. kernel require
  2. getoptlong require_order
  3. rubygems/custom_require require
  4. irb/ext/use-loader irb_require
  5. rdoc/require require

ライブラリ

キーワード

検索結果

<< 1 2 3 ... > >>

Vector#to_s -> String (27220.0)

ベクトル(Vector)から文字列 (String) に変換します。

...ベクトル(Vector)から文字列 (String) に変換します。

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

v = Vector[2, 3, 5, 7, 9]
p v.to_s
# => "Vector[2, 3, 5, 7, 9]"
//}...

Gem::Requirement#to_s -> String (27214.0)

条件を表す文字列を返します。

...条件を表す文字列を返します。

//emlist[][ruby]{
req = Gem::Requirement.new(["< 5.0", ">= 1.9"])
p req.to_s # => "< 5.0, >= 1.9"
//}...

BigDecimal#to_s -> String (24323.0)

self を文字列に変換します (デフォルトは "0.xxxxxen" の形になります)。

...nteger または String で指定します。

//emlist[][ruby]{
require
"bigdecimal"
BigDecimal("1.23456").to_s # ==> "0.123456e1"
//}

引数 n に正の整数が指定されたときは、小数点で分けられる左右部分を、
それぞれ n 桁毎に空白で区切ります。

//emlist...
...[][ruby]{
require
"bigdecimal"
BigDecimal("0.1234567890123456789").to_s(10) # => "0.1234567890 123456789e0"
//}

引数 n に正の整数を表す文字列を指定することもできます。

//emlist[][ruby]{
require
"bigdecimal"
BigDecimal("0.1234567890123456789").to_s("10") # => "0.12345678...
...きます。負の場合は常に '-' が付きます。

//emlist[][ruby]{
require
"bigdecimal"
BigDecimal("0.123456").to_s(" 3") # => " 0.123 456e0"
BigDecimal("0.123456").to_s("+3") # => "+0.123 456e0"
BigDecimal("-0.123456").to_s("3") # => "-0.123 456e0"
//}

さらに文字列の最後に指数...

BigDecimal#to_s(n) -> String (24323.0)

self を文字列に変換します (デフォルトは "0.xxxxxen" の形になります)。

...nteger または String で指定します。

//emlist[][ruby]{
require
"bigdecimal"
BigDecimal("1.23456").to_s # ==> "0.123456e1"
//}

引数 n に正の整数が指定されたときは、小数点で分けられる左右部分を、
それぞれ n 桁毎に空白で区切ります。

//emlist...
...[][ruby]{
require
"bigdecimal"
BigDecimal("0.1234567890123456789").to_s(10) # => "0.1234567890 123456789e0"
//}

引数 n に正の整数を表す文字列を指定することもできます。

//emlist[][ruby]{
require
"bigdecimal"
BigDecimal("0.1234567890123456789").to_s("10") # => "0.12345678...
...きます。負の場合は常に '-' が付きます。

//emlist[][ruby]{
require
"bigdecimal"
BigDecimal("0.123456").to_s(" 3") # => " 0.123 456e0"
BigDecimal("0.123456").to_s("+3") # => "+0.123 456e0"
BigDecimal("-0.123456").to_s("3") # => "-0.123 456e0"
//}

さらに文字列の最後に指数...

OpenSSL::BN#to_s(base=10) -> String (24298.0)

自身を表す文字列を返します。

...mlist[][ruby]{
require
'openssl'

p 10.to_bn.to_s # => "10"
p (-5).to_bn.to_s # => "-5"

p 0.to_bn.to_s(16) # => "0"
p 9.to_bn.to_s(16) # => "09"
p 10.to_bn.to_s(16) # => "0A"
p 16.to_bn.to_s(16) # => "10"
p 26.to_bn.to_s(16) # => "1A"
p 256.to_bn.to_s(16) # => "0100"

p 0.to_bn.to_s(2)...
...# => ""
p 6.to_bn.to_s(2) # => "\x06"
p 7.to_bn.to_s(2) # => "\a"

p 0.to_bn.to_s(0) # => "\x00\x00\x00\x00"
p 6.to_bn.to_s(0) # => "\x00\x00\x00\x01\x06"
p 7.to_bn.to_s(0) # => "\x00\x00\x00\x01\a"
//}

反対に、文字列から OpenSSL::BN クラスのインスタンスを作るには
OpenSSL::B...

絞り込み条件を変える

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

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

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

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

@see REXML::Text#value

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

Matrix#to_s -> String (24220.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 (24220.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"
//}...

Pathname#to_s -> String (24214.0)

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

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


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

path = Pathname.new("/tmp/hogehoge")
File.open(path)
//}...
<< 1 2 3 ... > >>