るりまサーチ

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

別のキーワード

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

クラス

キーワード

検索結果

<< 1 2 3 ... > >>

OpenSSL::X509::Extension#to_s -> String (24202.0)

拡張領域の内容を、文字列表現で返します。

拡張領域の内容を、文字列表現で返します。

Rake::InvocationChain::EmptyInvocationChain#to_s -> String (24202.0)

'TOP' という文字列を返します。

'TOP' という文字列を返します。

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

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

...big-endianの符号無し整数のバイナリ列
0 MPI形式の文字列(バイト列)

@param base 文字列への変換方法(基数)
@raise OpenSSL::BNError 変換に失敗した場合に発生します

//emlist[][ruby]{
require 'openssl'

p 10.to_bn.to_s # => "10"
p (-5).to_bn.to_s # =>...
...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::BN.new を用います。

@see OpenSSL::BN.new...

OpenSSL::X509::Name#to_s(flags=nil) -> String (21268.0)

DNの文字列表現を返します。

...DNの文字列表現を返します。

flags には通常は以下のいずれかを渡します。
* nil
* OpenSSL::X509::Name::COMPAT
* OpenSSL::X509::Name::RFC2253
* OpenSSL::X509::Name::ONELINE
* OpenSSL::X509::Name::MULTILINE

*
例:
require 'openssl'
n
= OpenSSL::X509::Name.pa...
...'/C=JP/ST=Kanagawa/L=Yokohama/O=Example Company/OU=Lab3/CN=foobar/emailAddress=foobar@lab3.example.co.jp')
n
.to_s
# => "/C=JP/ST=Kanagawa/L=Yokohama/O=Example Company/OU=Lab3/CN=foobar/emailAddress=foobar@lab3.example.co.jp"
n
.to_s(OpenSSL::X509::Name::COMPAT)
# => "C=JP, ST=Kanagawa, L=Yok...
...xample Company, OU=Lab3, CN=foobar/emailAddress=foobar@lab3.example.co.jp"
n
.to_s(OpenSSL::X509::Name::RFC2253)
# => "emailAddress=foobar@lab3.example.co.jp,CN=foobar,OU=Lab3,O=Example Company,L=Yokohama,ST=Kanagawa,C=JP"
n
.to_s(OpenSSL::X509::Name::ONELINE)
# => "C = JP, ST = Kanagawa, L =...

Range#to_s -> String (21230.0)

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

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

@see Range#inspect

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

絞り込み条件を変える

Rational#to_s -> String (21226.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...

String#to_s -> String (21226.0)

self を返します。

...uby]{
p "str".to_s # => "str"
p "str".to_str # => "str"
//}

このメソッドは、文字列を他のクラスのインスタンスと混ぜて処理したいときに有効です。
例えば返り値が文字列か nil であるメソッド some_method があるとき、
to_s
メソッド...
...を使うと以下のように統一的に処理できます。

//emlist[例][ruby]{
# some_method(5).downcase だと返り値が nil のときに
# エラーになるので to_s をはさむ
p some_method(5).to_s.downcase
//}...

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

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

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

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

Gem::Version#to_s -> String (21208.0)

バージョン情報を文字列として返します。

...バージョン情報を文字列として返します。

//emlist[][ruby]{
version = Gem::Version.new("1.2.3a")
p version.to_s # => "1.2.3a"
p version.version # => "1.2.3a"
//}...

NameError#to_s -> String (21208.0)

例外オブジェクトを文字列に変換して返します。

...オブジェクトを文字列に変換して返します。

例:

begin
foobar
rescue NameError => err
p err # => #<NameError: undefined local variable or method `foobar' for main:Object>
p err.to_s # => "undefined local variable or method `foobar' for main:Object"
end...

絞り込み条件を変える

<< 1 2 3 ... > >>