種類
ライブラリ
- English (12)
- ビルトイン (1526)
- benchmark (24)
- bigdecimal (60)
-
bigdecimal
/ util (12) - csv (48)
- date (36)
- digest (36)
- erb (12)
- fiddle (168)
-
fiddle
/ import (12) - ipaddr (36)
-
irb
/ context (60) -
irb
/ inspector (12) - json (12)
- matrix (24)
- monitor (12)
- observer (12)
- openssl (480)
- optparse (48)
- ostruct (38)
- pathname (839)
-
racc
/ parser (12) - rake (120)
- readline (12)
- resolv (36)
- rexml (12)
-
rexml
/ document (396) -
rubygems
/ package / tar _ header (12) -
rubygems
/ platform (12) -
rubygems
/ requirement (12) -
rubygems
/ version (24) - scanf (12)
- set (28)
-
shell
/ command-processor (6) -
shell
/ filter (12) - socket (48)
- stringio (24)
- uri (120)
-
webrick
/ httprequest (12) -
webrick
/ httpresponse (84) -
webrick
/ httputils (12) -
webrick
/ httpversion (12) -
webrick
/ log (72) -
win32
/ registry (24) - win32ole (144)
- zlib (24)
クラス
-
ARGF
. class (36) - Addrinfo (24)
- Array (84)
- BasicObject (12)
-
Benchmark
:: Tms (12) - BigDecimal (72)
- Bignum (6)
-
CGI
:: Cookie (12) -
CSV
:: Row (24) -
CSV
:: Table (24) - Complex (12)
- Data (6)
- Date (12)
- DateTime (24)
-
Digest
:: Base (24) - ERB (12)
- Encoding (24)
-
Enumerator
:: Lazy (22) - Exception (24)
- FalseClass (24)
-
Fiddle
:: Pointer (144) - File (12)
- Fixnum (6)
- Float (46)
-
Gem
:: Package :: TarHeader (12) -
Gem
:: Platform (12) -
Gem
:: Requirement (12) -
Gem
:: Version (24) - Hash (100)
- IO (36)
- IPAddr (36)
-
IRB
:: Context (60) -
IRB
:: Inspector (12) - Integer (24)
- MatchData (12)
- Matrix (12)
- Method (24)
- Module (36)
- NameError (12)
- NilClass (12)
- Object (78)
-
OpenSSL
:: BN (48) -
OpenSSL
:: Config (12) -
OpenSSL
:: HMAC (36) -
OpenSSL
:: Netscape :: SPKI (24) -
OpenSSL
:: PKCS7 (24) -
OpenSSL
:: PKey :: DH (36) -
OpenSSL
:: PKey :: DSA (72) -
OpenSSL
:: PKey :: RSA (72) -
OpenSSL
:: X509 :: CRL (24) -
OpenSSL
:: X509 :: Certificate (24) -
OpenSSL
:: X509 :: Extension (12) -
OpenSSL
:: X509 :: Name (60) -
OpenSSL
:: X509 :: Request (24) - OpenStruct (38)
- OptionParser (24)
-
OptionParser
:: ParseError (24) - Pathname (839)
- Proc (24)
-
Process
:: Status (12) -
REXML
:: Attribute (24) -
REXML
:: CData (36) -
REXML
:: Child (24) -
REXML
:: Comment (24) -
REXML
:: Declaration (12) -
REXML
:: DocType (12) -
REXML
:: Element (72) -
REXML
:: Elements (60) -
REXML
:: Entity (24) -
REXML
:: ExternalEntity (12) -
REXML
:: NotationDecl (12) -
REXML
:: ParseException (12) -
REXML
:: Text (48) -
Racc
:: Parser (12) -
Rake
:: EarlyTime (12) -
Rake
:: FileList (12) -
Rake
:: InvocationChain (36) -
Rake
:: InvocationChain :: EmptyInvocationChain (12) -
Rake
:: Task (12) -
Rake
:: TaskArguments (24) - Range (36)
- Rational (24)
- Regexp (24)
-
Resolv
:: DNS :: Name (12) -
Resolv
:: IPv4 (12) -
Resolv
:: IPv6 (12) -
Scanf
:: FormatSpecifier (6) -
Scanf
:: FormatString (6) - Set (16)
-
Shell
:: CommandProcessor (6) -
Shell
:: Filter (12) -
Socket
:: Option (24) - String (108)
- StringIO (24)
- Struct (24)
- Symbol (317)
- Thread (40)
-
Thread
:: Backtrace :: Location (24) - Time (18)
- TrueClass (12)
-
URI
:: FTP (24) -
URI
:: Generic (72) -
URI
:: LDAP (24) - UnboundMethod (36)
- UncaughtThrowError (11)
- Vector (12)
-
WEBrick
:: BasicLog (72) -
WEBrick
:: Cookie (12) -
WEBrick
:: HTTPRequest (12) -
WEBrick
:: HTTPResponse (84) -
WEBrick
:: HTTPUtils :: FormData (12) -
WEBrick
:: HTTPVersion (12) -
WIN32OLE
_ EVENT (12) -
WIN32OLE
_ METHOD (24) -
WIN32OLE
_ PARAM (24) -
WIN32OLE
_ TYPE (36) -
WIN32OLE
_ TYPELIB (24) -
WIN32OLE
_ VARIABLE (24) -
Win32
:: Registry (24) -
Zlib
:: GzipWriter (24)
モジュール
- Benchmark (12)
- Enumerable (24)
-
Fiddle
:: Importer (12) -
JSON
:: Generator :: GeneratorMethods :: Object (12) - Kernel (96)
-
OpenSSL
:: Buffering (12) -
REXML
:: Node (12)
オブジェクト
- ENV (12)
-
Readline
:: HISTORY (12) - main (24)
キーワード
-
$ ERROR _ INFO (12) - % (24)
- +@ (12)
- -@ (12)
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - << (60)
- =~ (12)
- Base (12)
- BlockCaller (12)
- COMPAT (12)
- Closure (12)
- ExternalEntity (12)
- InvocationChain (12)
- Location (12)
- MULTILINE (12)
- MonitorMixin (12)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 5 . 0 (8) -
NEWS for Ruby 2
. 7 . 0 (6) -
NEWS for Ruby 3
. 0 . 0 (5) - NotationDecl (12)
- Numeric (12)
- ONELINE (12)
- Observable (12)
- RFC2253 (12)
- String (12)
- Symbol (12)
- [] (84)
- []= (48)
-
_ _ to _ s _ _ (12) - add (12)
-
add
_ delegate _ command _ to _ shell (6) -
add
_ element (12) -
add
_ namespace (24) -
add
_ trace _ func (12) -
all
_ symbols (12) - append (12)
- atime (12)
-
avalue
_ to _ svalue (12) - basename (12)
- bigdecimal (12)
-
bigdecimal
/ math (12) - bind (12)
- binread (12)
- binwrite (12)
- birthtime (11)
- blockdev? (12)
- body= (12)
- build (48)
- capitalize (12)
- chardev? (12)
- chmod (12)
- chown (12)
- chunked= (12)
-
content
_ length (12) -
content
_ length= (12) - ctime (12)
- data (12)
- debug (12)
-
def
_ inspector (12) -
define
_ singleton _ method (24) - delete (12)
-
delete
_ all (12) -
delete
_ element (12) -
delete
_ namespace (12) - directory? (12)
- dirname (12)
- downcase (12)
-
each
_ entry (15) -
each
_ line (24) - empty? (9)
-
end
_ with? (6) - entities (12)
- error (12)
- executable? (12)
-
executable
_ real? (12) - exist? (12)
- export (60)
- extname (12)
- fatal (12)
- file? (12)
- find (24)
- fnmatch (12)
- fnmatch? (12)
- format (12)
- ftype (12)
- grep (12)
-
grep
_ v (10) - grpowned? (12)
- handler= (12)
- help (12)
- hex (12)
- hexdigest (24)
- hostname= (12)
-
http
_ version (12) - id2name (12)
- info (12)
- inspect (283)
- inspect? (12)
-
inspect
_ mode= (12) - intern (12)
- irb (12)
-
irb
/ completion (12) -
irb
/ ext / math-mode (4) - join (12)
- lchmod (24)
- lchown (12)
- length (12)
- lstat (12)
-
make
_ link (12) -
make
_ symlink (12) - match (12)
- measure (12)
- merge! (12)
-
method
_ missing (12) - mkdir (12)
- mkpath (12)
- modulo (12)
- mtime (12)
-
mvalue
_ to _ svalue (12) - name (101)
- new (84)
- next (12)
-
next
_ float (11) -
next
_ sibling= (12) - normalize (12)
- normalize! (12)
- oct (12)
- open (24)
- opendir (24)
-
optparse
/ date (12) - owned? (12)
- owner (12)
- parse (12)
- pipe? (12)
-
prev
_ float (11) -
previous
_ sibling= (12) - print (24)
-
proc
_ to _ s (12) - profile (6)
- ptr (12)
- puts (12)
-
rb
_ any _ to _ s (12) -
rb
_ ary _ pop (12) -
rb
_ ary _ to _ s (12) -
rb
_ class _ path (12) -
rb
_ mod _ to _ s (12) - read (12)
- readable? (12)
-
readable
_ real? (12) - readlines (12)
- readlink (12)
- ref (12)
- remainder (12)
- rename (12)
- resolv (12)
- rmdir (12)
- rmtree (12)
- rss (12)
-
ruby 1
. 6 feature (12) -
set
_ trace _ func (24) - setgid? (12)
- setuid? (12)
- size (24)
- size? (12)
- slice (60)
- socket? (12)
- split (12)
- sprintf (12)
- sprintf フォーマット (12)
- src (12)
-
start
_ with? (6) - stat (12)
- sticky? (12)
- string (12)
- strptime (12)
- succ (24)
- swapcase (12)
- symlink? (12)
- sysopen (12)
- syswrite (12)
- text= (12)
- then (14)
-
to
_ csv (24) -
to
_ digits (12) -
to
_ f (12) -
to
_ h (14) -
to
_ i (12) -
to
_ json (12) -
to
_ path (12) -
to
_ pem (120) -
to
_ proc (12) -
to
_ set (24) -
to
_ sockaddr (12) -
to
_ str (48) -
to
_ string (24) -
to
_ sym (24) -
token
_ to _ str (12) - tracer (12)
-
transform
_ keys (20) -
transform
_ keys! (20) -
transform
_ values (18) -
transform
_ values! (18) - truncate (12)
- uniq (24)
- uniq! (24)
- upcase (12)
- userinfo= (12)
- utime (12)
- value (24)
- value= (12)
- version (12)
- warn (24)
-
world
_ readable? (12) -
world
_ writable? (12) - writable? (12)
-
writable
_ real? (12) - write (72)
-
yield
_ self (16) - zero? (12)
- | (6)
- メソッド呼び出し(super・ブロック付き・yield) (10)
検索結果
先頭5件
-
OpenSSL
:: BN # to _ s(base=10) -> String (18185.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 (18162.0) -
self を文字列に変換します (デフォルトは "0.xxxxxen" の形になります)。
...Decimal("1.23456").to_s # ==> "0.123456e1"
//}
引数 n に正の整数が指定されたときは、小数点で分けられる左右部分を、
それぞれ n 桁毎に空白で区切ります。
//emlist[][ruby]{
require "bigdecimal"
BigDecimal("0.1234567890123456789").to_s(10) # => "0.123......456789").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') か指数を使わない形式
('F' または 'f') かを指定出来ます。デフォルトは指数形... -
BigDecimal
# to _ s(n) -> String (18162.0) -
self を文字列に変換します (デフォルトは "0.xxxxxen" の形になります)。
...Decimal("1.23456").to_s # ==> "0.123456e1"
//}
引数 n に正の整数が指定されたときは、小数点で分けられる左右部分を、
それぞれ n 桁毎に空白で区切ります。
//emlist[][ruby]{
require "bigdecimal"
BigDecimal("0.1234567890123456789").to_s(10) # => "0.123......456789").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') か指数を使わない形式
('F' または 'f') かを指定出来ます。デフォルトは指数形... -
Complex
# to _ s -> String (18131.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 (18131.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 (18129.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 (18125.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 (18125.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
//}... -
ENV
. to _ s -> String (18117.0) -
環境変数を文字列化します。 Hash#to_s と同じように動作します。
...環境変数を文字列化します。 Hash#to_s と同じように動作します。...