種類
ライブラリ
- English (66)
- ビルトイン (2128)
- benchmark (11)
- bigdecimal (33)
-
bigdecimal
/ util (22) -
cgi
/ core (11) -
cgi
/ html (44) - csv (143)
- date (11)
- dbm (11)
- digest (22)
- erb (22)
- etc (22)
- fiddle (66)
- gdbm (22)
- getoptlong (33)
- ipaddr (44)
-
irb
/ cmd / help (11) -
irb
/ context (33) -
irb
/ ext / save-history (11) - json (231)
-
json
/ add / bigdecimal (11) -
json
/ add / complex (11) -
json
/ add / date (11) -
json
/ add / date _ time (11) -
json
/ add / exception (11) -
json
/ add / ostruct (11) -
json
/ add / range (11) -
json
/ add / rational (11) -
json
/ add / regexp (11) -
json
/ add / struct (11) -
json
/ add / symbol (11) -
json
/ add / time (11) - kconv (176)
- logger (11)
- matrix (33)
- mkmf (11)
-
net
/ http (22) -
net
/ imap (11) -
net
/ pop (11) -
net
/ smtp (61) - openssl (847)
- optparse (162)
- ostruct (22)
- pathname (99)
- pstore (44)
- psych (99)
- rake (110)
- rbconfig (11)
-
rdoc
/ generator / darkfish (11) -
rdoc
/ generator / json _ index (11) -
rdoc
/ generator / ri (11) -
rdoc
/ markup (44) -
rdoc
/ top _ level (33) - readline (110)
- resolv (33)
- rexml (11)
-
rexml
/ document (165) -
ripper
/ lexer (22) -
rubygems
/ ext / builder (11) -
rubygems
/ indexer (22) -
rubygems
/ package / tar _ header (11) -
rubygems
/ platform (11) -
rubygems
/ requirement (11) -
rubygems
/ source _ index (11) -
rubygems
/ specification (22) -
rubygems
/ validator (11) -
rubygems
/ version (22) - scanf (6)
- sdbm (22)
- securerandom (11)
- set (14)
- shell (24)
-
shell
/ command-processor (6) -
shell
/ filter (18) - socket (99)
- stringio (105)
- uri (77)
-
webrick
/ httpauth / authenticator (44) -
webrick
/ httprequest (11) -
webrick
/ httpresponse (33) -
webrick
/ httputils (11) -
webrick
/ httpversion (11) - win32ole (132)
-
yaml
/ dbm (11)
クラス
-
ARGF
. class (22) - Addrinfo (22)
- Array (96)
-
Benchmark
:: Tms (11) - BigDecimal (55)
- Bignum (6)
-
CGI
:: Cookie (11) - CSV (77)
-
CSV
:: Row (22) -
CSV
:: Table (22) - Complex (22)
- DBM (11)
- Data (4)
- Date (22)
- DateTime (11)
-
Digest
:: Base (22) - Dir (22)
- ERB (22)
- Encoding (22)
-
Encoding
:: Converter (66) - Enumerator (22)
-
Enumerator
:: ArithmeticSequence (6) -
Enumerator
:: Chain (6) - Exception (51)
- FalseClass (22)
-
Fiddle
:: Pointer (66) - File (44)
- Fixnum (6)
- Float (22)
- GDBM (22)
-
Gem
:: Ext :: Builder (11) -
Gem
:: Indexer (22) -
Gem
:: Package :: TarHeader (11) -
Gem
:: Platform (11) -
Gem
:: Requirement (11) -
Gem
:: SourceIndex (11) -
Gem
:: Specification (22) -
Gem
:: Validator (11) -
Gem
:: Version (22) - GetoptLong (33)
- Hash (22)
- IO (15)
- IPAddr (44)
-
IRB
:: Context (44) -
IRB
:: ExtendCommand :: Help (11) - Integer (22)
- Logger (11)
- MatchData (88)
- Matrix (11)
- Method (22)
- Module (55)
- NameError (11)
-
Net
:: HTTPResponse (22) -
Net
:: IMAP :: Envelope (11) -
Net
:: POPMail (11) -
Net
:: SMTP (61) - NilClass (11)
- Object (147)
-
OpenSSL
:: ASN1 :: ASN1Data (11) -
OpenSSL
:: BN (11) -
OpenSSL
:: Config (11) -
OpenSSL
:: HMAC (33) -
OpenSSL
:: Netscape :: SPKI (44) -
OpenSSL
:: OCSP :: Request (11) -
OpenSSL
:: OCSP :: Response (11) -
OpenSSL
:: PKCS12 (11) -
OpenSSL
:: PKCS7 (44) -
OpenSSL
:: PKey :: DH (55) -
OpenSSL
:: PKey :: DSA (88) -
OpenSSL
:: PKey :: EC (33) -
OpenSSL
:: PKey :: EC :: Group (33) -
OpenSSL
:: PKey :: RSA (88) -
OpenSSL
:: SSL :: Session (33) -
OpenSSL
:: X509 :: Attribute (11) -
OpenSSL
:: X509 :: CRL (44) -
OpenSSL
:: X509 :: Certificate (66) -
OpenSSL
:: X509 :: Extension (33) -
OpenSSL
:: X509 :: ExtensionFactory (33) -
OpenSSL
:: X509 :: Name (33) -
OpenSSL
:: X509 :: Request (44) -
OpenSSL
:: X509 :: Store (11) -
OpenSSL
:: X509 :: StoreContext (33) - OpenStruct (33)
- OptionParser (140)
-
OptionParser
:: ParseError (22) - PStore (44)
- Pathname (99)
- Proc (33)
-
Process
:: Status (11) -
Psych
:: Nodes :: Node (22) -
Psych
:: ScalarScanner (11) -
Psych
:: Visitors :: YAMLTree (11) -
RDoc
:: Generator :: Darkfish (11) -
RDoc
:: Generator :: JsonIndex (11) -
RDoc
:: Generator :: RI (11) -
RDoc
:: Markup (33) -
RDoc
:: TopLevel (33) -
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
:: Application (11) -
Rake
:: EarlyTime (11) -
Rake
:: FileList (11) -
Rake
:: InvocationChain (11) -
Rake
:: InvocationChain :: EmptyInvocationChain (11) -
Rake
:: Task (11) -
Rake
:: TaskArguments (22) - Range (57)
- Rational (33)
- Regexp (33)
-
Resolv
:: DNS :: Name (11) -
Resolv
:: IPv4 (11) -
Resolv
:: IPv6 (11) - Ripper (11)
-
Ripper
:: Lexer (11) -
RubyVM
:: InstructionSequence (18) - SDBM (22)
-
Scanf
:: FormatString (6) - Set (14)
- Shell (24)
-
Shell
:: CommandProcessor (6) -
Shell
:: Filter (18) - Socket (22)
-
Socket
:: Option (22) - String (501)
- StringIO (105)
- Struct (77)
- Symbol (308)
- Thread (25)
-
Thread
:: Backtrace :: Location (33) - Time (27)
- TracePoint (22)
- TrueClass (11)
- UDPSocket (33)
-
URI
:: Generic (33) -
URI
:: MailTo (44) - UnboundMethod (22)
- UncaughtThrowError (10)
- Vector (22)
-
WEBrick
:: Cookie (11) -
WEBrick
:: HTTPRequest (11) -
WEBrick
:: HTTPResponse (33) -
WEBrick
:: HTTPUtils :: FormData (11) -
WEBrick
:: HTTPVersion (11) -
WIN32OLE
_ METHOD (33) -
WIN32OLE
_ PARAM (22) -
WIN32OLE
_ TYPE (33) -
WIN32OLE
_ TYPELIB (22) -
WIN32OLE
_ VARIABLE (22) -
YAML
:: DBM (11)
モジュール
-
CGI
:: HtmlExtension (44) -
CGI
:: QueryExtension (11) - Etc (22)
- JSON (55)
-
JSON
:: Generator :: GeneratorMethods :: Array (11) -
JSON
:: Generator :: GeneratorMethods :: FalseClass (11) -
JSON
:: Generator :: GeneratorMethods :: Float (11) -
JSON
:: Generator :: GeneratorMethods :: Hash (11) -
JSON
:: Generator :: GeneratorMethods :: Integer (11) -
JSON
:: Generator :: GeneratorMethods :: NilClass (11) -
JSON
:: Generator :: GeneratorMethods :: Object (11) -
JSON
:: Generator :: GeneratorMethods :: String (33) -
JSON
:: Generator :: GeneratorMethods :: String :: Extend (11) -
JSON
:: Generator :: GeneratorMethods :: TrueClass (11) - Kconv (88)
- Kernel (198)
- Marshal (11)
- Psych (33)
-
REXML
:: Node (11) - Rake (11)
- RbConfig (11)
- Readline (11)
-
RubyVM
:: AbstractSyntaxTree (2) -
WEBrick
:: HTTPAuth :: Authenticator (44)
オブジェクト
- ENV (139)
-
Readline
:: HISTORY (99)
キーワード
-
$ FIELD _ SEPARATOR (11) -
$ FS (11) -
$ INPUT _ RECORD _ SEPARATOR (11) -
$ OUTPUT _ FIELD _ SEPARATOR (11) -
$ OUTPUT _ RECORD _ SEPARATOR (11) -
$ RS (11) -
$ topdir (11) - % (23)
- * (22)
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - << (22)
- <=> (11)
- == (11)
- === (11)
- =~ (11)
- ASN1 (11)
- CSV (11)
- Complex (11)
- DESCRIPTION (11)
-
EMPTY
_ MARSHAL _ CHECKSUM (11) -
EMPTY
_ MARSHAL _ DATA (11) -
EMPTY
_ STRING (11) - Enumerator (11)
- Extend (22)
- Float (11)
-
GENERATOR
_ DIR (11) - HeaderConverters (11)
- Integer (11)
- Markup (11)
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 2
. 2 . 0 (10) -
NEWS for Ruby 2
. 3 . 0 (9) -
NEWS for Ruby 2
. 4 . 0 (8) -
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 2
. 6 . 0 (6) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) -
NEWS for Ruby 3
. 1 . 0 (3) - OCSP (11)
- RequestField (11)
- ResponseField (11)
- ResponseInfoField (11)
- Ruby用語集 (11)
-
SC
_ MONOTONIC _ CLOCK (11) -
SC
_ THREAD _ DESTRUCTOR _ ITERATIONS (11) -
SEARCH
_ INDEX _ FILE (11) - STR2CSTR (11)
- SafeStringValue (11)
- SecureRandom (11)
- StringValue (11)
- StringValuePtr (11)
- Symbol (11)
- TOPDIR (11)
- [] (154)
- []= (33)
-
_ _ to _ s _ _ (11) -
absolute
_ path (11) -
add
_ element (11) -
add
_ html (11) -
add
_ special (11) -
add
_ word _ pair (11) - autoload (22)
- autoload? (22)
- autorequire (11)
- bigdecimal (11)
-
bigdecimal
/ util (11) - binread (11)
- binwrite (11)
- bytes (29)
- caller (33)
- capitalize (11)
- captures (11)
- casecmp (11)
- casecmp? (8)
- chars (29)
- clone (11)
- codepoints (29)
-
col
_ sep (11) -
content
_ length (11) -
content
_ length= (11) -
create
_ ext _ from _ string (11) -
create
_ extension (22) -
create
_ id (11) - data (11)
-
default
_ record _ separator (6) -
default
_ record _ separator= (6) -
define
_ singleton _ method (22) - delete (22)
-
delete
_ at (11) -
dest
_ directory (11) - directory (11)
- downcase (11)
- dump (22)
- dup (11)
- each (33)
-
each
_ byte (22) -
each
_ char (22) -
each
_ codepoint (33) -
each
_ grapheme _ cluster (14) -
each
_ line (33) - echo (18)
-
end
_ with? (5) - entities (11)
- error= (11)
-
error
_ string (22) - execute (11)
- export (55)
- extname (11)
- fetch (33)
-
file
_ absolute _ name (11) -
file
_ relative _ name (11) - format (11)
- formatter (11)
- ftype (11)
-
full
_ name (11) - generate (11)
- get (11)
-
get
_ option (11) - getaddrinfo (11)
- getservbyport (11)
-
grapheme
_ clusters (14) - gsub (22)
- gsub! (11)
- headers (11)
- help (11)
- helpstring (11)
- hex (11)
- hexdigest (22)
-
history
_ file (11) - hton (11)
- id2name (11)
-
in
_ reply _ to (11) - index (7)
-
insert
_ output (11) - inspect (281)
-
installed
_ spec _ directories (11) - intern (22)
- irb (11)
- join (22)
-
json
_ create (11) - kconv (22)
- key (11)
- length (11)
- lines (29)
-
load
_ from _ binary _ extra _ data (9) - logger (11)
- match (11)
- name (81)
-
net
/ smtp (11) - new (110)
- next (11)
- normalize (11)
- normalize! (11)
- ntop (11)
- oct (11)
- open (44)
- order (32)
- order! (16)
-
original
_ dir (22) - pack (19)
- pack テンプレート文字列 (11)
- parse (18)
- parse! (8)
- path (57)
- pathmap (11)
- permute (16)
- permute! (8)
- pop (11)
-
pretty
_ generate (11) -
pretty
_ unparse (11) -
program
_ name (11) -
psych
_ to _ yaml (11) -
public
_ method (11) - push (11)
- putback (22)
-
rb
_ to _ id (11) - rdoc (11)
-
rdoc
/ markup / to _ ansi (11) -
rdoc
/ markup / to _ bs (11) -
rdoc
/ markup / to _ html (11) - read (11)
-
read
_ body (22) - readline (11)
- readlines (11)
- realm (11)
-
record
_ separator (6) - redirector (11)
-
remove
_ leading _ dot _ dir (11) - restore (11)
- result (11)
- rss (11)
-
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 2 feature (11) -
ruby 1
. 8 . 3 feature (11) -
ruby 1
. 8 . 4 feature (11) -
ruby 1
. 9 feature (11) -
rubygems
/ commands / list _ command (11) -
rubygems
/ commands / search _ command (11) - send (33)
-
send
_ mail (11) - sendmail (11)
-
server
_ protocol (11) -
set
_ backtrace (11) - shift (11)
-
singleton
_ class (11) -
singleton
_ method (11) - size (11)
- slice (55)
-
source
_ location (11) - split (11)
- sprintf (11)
- sprintf フォーマット (11)
- src (11)
- start (28)
-
start
_ with? (5) - step (12)
- store (44)
- string (11)
- succ (11)
- swapcase (11)
- syswrite (11)
- then (12)
-
to
_ a (94) -
to
_ binary (9) -
to
_ c (11) -
to
_ csv (33) -
to
_ d (11) -
to
_ der (198) -
to
_ digits (11) -
to
_ f (11) -
to
_ i (11) -
to
_ json (242) -
to
_ json _ raw (11) -
to
_ json _ raw _ object (11) -
to
_ mailtext (11) -
to
_ path (35) -
to
_ pem (143) -
to
_ r (11) -
to
_ rfc822text (11) -
to
_ ruby (11) -
to
_ s (1111) -
to
_ sockaddr (11) -
to
_ str (44) -
to
_ string (22) -
to
_ sym (22) -
to
_ text (110) -
to
_ yaml (22) - toeuc (22)
- tojis (22)
-
tokadd
_ string (11) - tokenize (33)
- tolocale (22)
- top (11)
- tosjis (22)
- toutf16 (22)
- toutf32 (22)
- toutf8 (22)
-
try
_ convert (22) - unpack (11)
- unparse (11)
- upcase (11)
- upto (11)
- value (22)
-
values
_ at (22) - verify (22)
- version (11)
-
with
_ object (22) - write (22)
- yaml (11)
-
yield
_ self (14) - クラス/メソッドの定義 (11)
- 正規表現 (11)
検索結果
先頭5件
-
String
# to _ i(base = 10) -> Integer (27245.0) -
文字列を 10 進数表現された整数であると解釈して、整数に変換します。
....to_i # => 10
p "+10".to_i # => 10
p "-10".to_i # => -10
p "010".to_i # => 10
p "-010".to_i # => -10
//}
整数とみなせない文字があればそこまでを変換対象とします。
変換対象が空文字列であれば 0 を返します。
//emlist[例][ruby]{
p "0x11".to......_i # => 0
p "".to_i # => 0
//}
基数を指定することでデフォルトの 10 進以外に 2 〜 36 進数表現へ変換できます。
それぞれ Ruby の整数リテラルで使用可能なプリフィクスは無視されます。
また、base に 0 を指定するとプリフ......"0o10".to_i(0) # => 8
p "010".to_i(0) # => 8
p "0d10".to_i(0) # => 10
p "0x10".to_i(0) # => 16
//}
@param base 進数を指定する整数。0 か、2〜36 の整数。
@return 整数
このメソッドの逆に数値を文字列に変換するには、
Kernel.#sprintf, String#%, In... -
String
# to _ s -> String (27234.0) -
self を返します。
...ruby]{
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
//}... -
String
# to _ str -> String (27234.0) -
self を返します。
...ruby]{
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
//}... -
String
# to _ f -> Float (27209.0) -
文字列を 10 進数表現と解釈して、浮動小数点数 Float に変換します。
...uby]{
p "-10".to_f # => -10.0
p "10e2".to_f # => 1000.0
p "1e-2".to_f # => 0.01
p ".1".to_f # => 0.1
p "1_0_0".to_f # => 100.0 # 数値リテラルと同じように区切りに _ を使える
p " \n10".to_f # => 10.0 # 先頭の空白・改行は無視される
p "7xa.5".to_f # => 7.0
//......返します。
変換対象が空文字列のケースでも、0.0 を返します。
//emlist[][ruby]{
p "".to_f # => 0.0
p "nan".to_f # => 0.0
p "INF".to_f # => 0.0
p "-Inf".to_f # => 0.0
//}
変換後の Float が有限の値を取れないときは、Float::INFINITY を用います......2
p ("10" * 1000).to_f # => Infinity
# warning: Float 10101010101010101010... out of range
//}
なお、このメソッドとは逆に、数値を文字列に変換するには
Kernel.#sprintf, String#%, Integer#to_s
を使用します。
@see String#hex, String#oct, String#to_i,
Kernel.#I... -
String
# tolocale -> String (27207.0) -
self のエンコーディングをロケールエンコーディングに変換した文字列を 返します。変換元のエンコーディングは文字列の内容から推測します。
...は Encoding.locale_charmap を見てください。
このメソッドは MIME エンコードされた文字列を展開し、
いわゆる半角カナを全角に変換します。
これらを変換したくない場合は、 String#encode
を使ってください。
@see Kconv.#tolocale... -
String
# toeuc -> String (27201.0) -
self のエンコーディングを EUC-JP に変換した文字列を 返します。変換元のエンコーディングは文字列の内容から推測します。
...ングは文字列の内容から推測します。
このメソッドは MIME エンコードされた文字列を展開し、
いわゆる半角カナを全角に変換します。
これらを変換したくない場合は、 NKF.#nkf('-exm0', str)
を使ってください。
@see Kconv.#toeuc... -
String
# tojis -> String (27201.0) -
self のエンコーディングを iso-2022-jp に変換した文字列を 返します。変換元のエンコーディングは文字列の内容から推測します。
...ングは文字列の内容から推測します。
このメソッドは MIME エンコードされた文字列を展開し、
いわゆる半角カナを全角に変換します。
これらを変換したくない場合は、 NKF.#nkf('-jxm0', str)
を使ってください。
@see Kconv.#tojis... -
String
# tosjis -> String (27201.0) -
self のエンコーディングを shift_jis に変換した文字列を 返します。変換元のエンコーディングは文字列の内容から推測します。
...グは文字列の内容から推測します。
このメソッドは MIME エンコードされた文字列を展開し、
いわゆる半角カナを全角に変換します。
これらを変換したくない場合は、 NKF.#nkf('-sxm0', str)
を使ってください。
@see Kconv.#tosjis... -
String
# toutf16 -> String (27201.0) -
self のエンコーディングを UTF-16BE に変換した文字列を 返します。変換元のエンコーディングは文字列の内容から推測します。
...は文字列の内容から推測します。
このメソッドは MIME エンコードされた文字列を展開し、
いわゆる半角カナを全角に変換します。
これらを変換したくない場合は、 NKF.#nkf('-w16xm0', str)
を使ってください。
@see Kconv.#toutf16... -
String
# toutf32 -> String (27201.0) -
self のエンコーディングを UTF-32 に変換した文字列を 返します。変換元のエンコーディングは文字列の内容から推測します。
...は文字列の内容から推測します。
このメソッドは MIME エンコードされた文字列を展開し、
いわゆる半角カナを全角に変換します。
これらを変換したくない場合は、 NKF.#nkf('-w32xm0', str)
を使ってください。
@see Kconv.#toutf32...