2591件ヒット
[1-100件を表示]
(0.066秒)
ライブラリ
- ビルトイン (1020)
- benchmark (11)
- bigdecimal (22)
-
bigdecimal
/ util (11) - csv (44)
- date (11)
- digest (22)
- erb (11)
- fiddle (66)
- ipaddr (22)
-
irb
/ context (33) - json (11)
- matrix (22)
- openssl (352)
- optparse (44)
- ostruct (22)
- pathname (99)
- rake (77)
- resolv (33)
- rexml (11)
-
rexml
/ document (165) -
rubygems
/ package / tar _ header (11) -
rubygems
/ platform (11) -
rubygems
/ requirement (11) -
rubygems
/ version (22) - scanf (6)
- set (14)
-
shell
/ filter (6) - socket (44)
- stringio (22)
- uri (33)
-
webrick
/ httprequest (11) -
webrick
/ httpresponse (33) -
webrick
/ httputils (11) -
webrick
/ httpversion (11) - win32ole (121)
クラス
-
ARGF
. class (22) - Addrinfo (22)
- Array (33)
-
Benchmark
:: Tms (11) - BigDecimal (33)
- Bignum (6)
-
CGI
:: Cookie (11) -
CSV
:: Row (22) -
CSV
:: Table (22) - Complex (11)
- Data (4)
- Date (11)
-
Digest
:: Base (22) - ERB (11)
- Encoding (22)
- Exception (22)
- FalseClass (22)
-
Fiddle
:: Pointer (66) - Fixnum (6)
- Float (22)
-
Gem
:: Package :: TarHeader (11) -
Gem
:: Platform (11) -
Gem
:: Requirement (11) -
Gem
:: Version (22) - Hash (22)
- IO (11)
- IPAddr (22)
-
IRB
:: Context (33) - Integer (22)
- MatchData (11)
- Matrix (11)
- Method (22)
- Module (33)
- NameError (11)
- NilClass (11)
- Object (70)
-
OpenSSL
:: BN (11) -
OpenSSL
:: Config (11) -
OpenSSL
:: HMAC (33) -
OpenSSL
:: Netscape :: SPKI (22) -
OpenSSL
:: PKCS7 (22) -
OpenSSL
:: PKey :: DH (33) -
OpenSSL
:: PKey :: DSA (66) -
OpenSSL
:: PKey :: RSA (66) -
OpenSSL
:: X509 :: CRL (22) -
OpenSSL
:: X509 :: Certificate (22) -
OpenSSL
:: X509 :: Extension (11) -
OpenSSL
:: X509 :: Name (11) -
OpenSSL
:: X509 :: Request (22) - OpenStruct (22)
- OptionParser (22)
-
OptionParser
:: ParseError (22) - Pathname (99)
- Proc (22)
-
Process
:: Status (11) -
REXML
:: Attribute (22) -
REXML
:: CData (22) -
REXML
:: Comment (22) -
REXML
:: Declaration (11) -
REXML
:: DocType (11) -
REXML
:: Element (11) -
REXML
:: Entity (11) -
REXML
:: ExternalEntity (11) -
REXML
:: NotationDecl (11) -
REXML
:: ParseException (11) -
REXML
:: Text (22) -
Rake
:: EarlyTime (11) -
Rake
:: FileList (11) -
Rake
:: InvocationChain (11) -
Rake
:: InvocationChain :: EmptyInvocationChain (11) -
Rake
:: Task (11) -
Rake
:: TaskArguments (22) - Range (22)
- Rational (22)
- Regexp (22)
-
Resolv
:: DNS :: Name (11) -
Resolv
:: IPv4 (11) -
Resolv
:: IPv6 (11) -
Scanf
:: FormatString (6) - Set (14)
-
Shell
:: Filter (6) -
Socket
:: Option (22) - String (99)
- StringIO (22)
- Struct (22)
- Symbol (267)
- Thread (14)
-
Thread
:: Backtrace :: Location (22) - Time (16)
- TrueClass (11)
-
URI
:: Generic (33) - UnboundMethod (22)
- UncaughtThrowError (10)
- Vector (11)
-
WEBrick
:: Cookie (11) -
WEBrick
:: HTTPRequest (11) -
WEBrick
:: HTTPResponse (33) -
WEBrick
:: HTTPUtils :: FormData (11) -
WEBrick
:: HTTPVersion (11) -
WIN32OLE
_ METHOD (22) -
WIN32OLE
_ PARAM (22) -
WIN32OLE
_ TYPE (33) -
WIN32OLE
_ TYPELIB (22) -
WIN32OLE
_ VARIABLE (22)
モジュール
-
JSON
:: Generator :: GeneratorMethods :: Object (11) - Kernel (33)
-
REXML
:: Node (11)
オブジェクト
- ENV (11)
キーワード
- % (11)
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - << (11)
- =~ (11)
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) - String (11)
- Symbol (11)
- [] (77)
-
_ _ to _ s _ _ (11) -
add
_ element (11) - bigdecimal (11)
- binread (11)
- binwrite (11)
- capitalize (11)
-
content
_ length (11) -
content
_ length= (11) - data (11)
-
define
_ singleton _ method (22) - downcase (11)
-
end
_ with? (5) - entities (11)
- export (55)
- extname (11)
- format (11)
- ftype (11)
- help (11)
- hex (11)
- hexdigest (22)
- id2name (11)
- inspect (247)
- intern (11)
- irb (11)
- join (11)
- length (11)
- match (11)
- name (81)
- next (11)
- normalize (11)
- normalize! (11)
- oct (11)
- read (11)
- readlines (11)
- rss (11)
-
ruby 1
. 6 feature (11) - size (11)
- slice (55)
- sprintf (11)
- sprintf フォーマット (11)
- src (11)
-
start
_ with? (5) - succ (11)
- swapcase (11)
- syswrite (11)
- then (12)
-
to
_ csv (22) -
to
_ digits (11) -
to
_ f (11) -
to
_ i (11) -
to
_ json (11) -
to
_ path (11) -
to
_ pem (110) -
to
_ sockaddr (11) -
to
_ str (44) -
to
_ string (22) -
to
_ sym (22) - upcase (11)
- value (22)
- version (11)
- write (22)
-
yield
_ self (14)
検索結果
先頭5件
-
String
# to _ s -> String (27227.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
//}... -
Scanf
:: FormatString # to _ s (21101.0) -
@todo
@todo -
OpenSSL
:: BN # to _ s(base=10) -> String (18286.0) -
自身を表す文字列を返します。
...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::BN.new を用います。
@see Op... -
BigDecimal
# to _ s -> String (18270.0) -
self を文字列に変換します (デフォルトは "0.xxxxxen" の形になります)。
...フォルトは "0.xxxxxen" の形になります)。
@param n 出力の形式を Integer または String で指定します。
//emlist[][ruby]{
require "bigdecimal"
BigDecimal("1.23456").to_s # ==> "0.123456e1"
//}
引数 n に正の整数が指定されたときは、小数点で分けら......decimal"
BigDecimal("0.1234567890123456789").to_s(10) # => "0.1234567890 123456789e0"
//}
引数 n に正の整数を表す文字列を指定することもできます。
//emlist[][ruby]{
require "bigdecimal"
BigDecimal("0.1234567890123456789").to_s("10") # => "0.1234567890 123456789e0"
//}......常に '-' が付きます。
//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"
//}
さらに文字列の最後に指数形式 ('E' または 'e')... -
BigDecimal
# to _ s(n) -> String (18270.0) -
self を文字列に変換します (デフォルトは "0.xxxxxen" の形になります)。
...フォルトは "0.xxxxxen" の形になります)。
@param n 出力の形式を Integer または String で指定します。
//emlist[][ruby]{
require "bigdecimal"
BigDecimal("1.23456").to_s # ==> "0.123456e1"
//}
引数 n に正の整数が指定されたときは、小数点で分けら......decimal"
BigDecimal("0.1234567890123456789").to_s(10) # => "0.1234567890 123456789e0"
//}
引数 n に正の整数を表す文字列を指定することもできます。
//emlist[][ruby]{
require "bigdecimal"
BigDecimal("0.1234567890123456789").to_s("10") # => "0.1234567890 123456789e0"
//}......常に '-' が付きます。
//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"
//}
さらに文字列の最後に指数形式 ('E' または 'e')... -
Complex
# to _ s -> String (18232.0) -
自身を "実部 + 虚部i" 形式の文字列にして返します。
...。
//emlist[例][ruby]{
Complex(2).to_s # => "2+0i"
Complex('-8/6').to_s # => "-4/3+0i"
Complex('1/2i').to_s # => "0+1/2i"
Complex(0, Float::INFINITY).to_s # => "0+Infinity*i"
Complex(Float::NAN, Float::NAN).to_s # => "NaN+NaN*i"
//}... -
OpenSSL
:: X509 :: Name # to _ s(flags=nil) -> String (18232.0) -
DNの文字列表現を返します。
...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=Yokohama, O=Example Company, OU=Lab3, CN=foobar/emailAddress=foobar@lab3.example.co.jp"
n.to_s(OpenSSL:......bar,OU=Lab3,O=Example Company,L=Yokohama,ST=Kanagawa,C=JP"
n.to_s(OpenSSL::X509::Name::ONELINE)
# => "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::MULTILINE)
# => "countryName... -
Range
# to _ s -> String (18230.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 (18226.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... -
Vector
# to _ s -> String (18224.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]"
//}...