種類
ライブラリ
- English (276)
- ビルトイン (2696)
- bigdecimal (16)
- continuation (12)
- delegate (12)
- digest (12)
- e2mmap (18)
-
irb
/ cmd / load (12) -
irb
/ xmp (24) - json (24)
-
minitest
/ unit (1) - mkmf (624)
- open-uri (80)
- open3 (24)
- openssl (24)
- pathname (24)
- pp (16)
- profiler (6)
- psych (24)
- pty (48)
- rake (36)
-
rubygems
/ custom _ require (12) - scanf (12)
- shell (12)
-
shell
/ command-processor (18) -
shell
/ filter (12) - socket (72)
- stringio (108)
- syslog (12)
- tempfile (55)
-
test
/ unit (1) - timeout (29)
- tracer (12)
- un (72)
- win32ole (12)
- zlib (48)
クラス
-
ARGF
. class (75) - Array (48)
- BasicObject (24)
- BigDecimal (2)
- Binding (12)
- Complex (24)
- Exception (24)
- File (36)
- IO (468)
-
IRB
:: ExtendCommand :: Load (12) - LoadError (12)
- Module (144)
- Object (168)
-
OpenSSL
:: BN (12) - Proc (19)
- Shell (12)
-
Shell
:: CommandProcessor (18) -
Shell
:: Filter (12) - Socket (36)
- String (72)
- StringIO (108)
- SystemExit (12)
- Tempfile (55)
- Thread (72)
- TracePoint (12)
- Tracer (12)
- UncaughtThrowError (22)
-
WIN32OLE
_ EVENT (12) - XMP (12)
-
Zlib
:: GzipWriter (48)
モジュール
- Exception2MessageMapper (18)
- FileTest (12)
- Kernel (2478)
-
MiniTest
:: Assertions (1) - Open3 (24)
-
OpenSSL
:: Buffering (12) - OpenURI (24)
-
OpenURI
:: OpenRead (24) - PTY (48)
- Process (96)
-
Socket
:: Constants (36) - Syslog (12)
-
Test
:: Unit (1) - Timeout (21)
- URI (16)
キーワード
-
$ ! (12) -
$ & (12) -
$ & # 39; (12) -
$ -F (12) -
$ -I (6) -
$ -p (12) -
$ 1 (12) -
$ 10 (12) -
$ 11 (12) -
$ 2 (12) -
$ 3 (12) -
$ 4 (12) -
$ 5 (12) -
$ 6 (12) -
$ 7 (12) -
$ 8 (12) -
$ 9 (12) -
$ : (6) -
$ ; (12) -
$ > (12) -
$ ? (12) -
$ ARGV (12) -
$ CHILD _ STATUS (12) -
$ DEFAULT _ INPUT (12) -
$ DEFAULT _ OUTPUT (12) -
$ ERROR _ INFO (12) -
$ ERROR _ POSITION (12) -
$ FIELD _ SEPARATOR (12) -
$ FS (12) -
$ INPUT _ LINE _ NUMBER (12) -
$ INPUT _ RECORD _ SEPARATOR (12) -
$ LAST _ MATCH _ INFO (12) -
$ LAST _ PAREN _ MATCH (12) -
$ LAST _ READ _ LINE (12) -
$ LOAD _ PATH (12) -
$ MATCH (12) -
$ NR (12) -
$ OFS (12) -
$ OUTPUT _ FIELD _ SEPARATOR (12) -
$ OUTPUT _ RECORD _ SEPARATOR (12) -
$ PID (12) -
$ POSTMATCH (12) -
$ PREMATCH (12) -
$ PROCESS _ ID (12) -
$ PROGRAM _ NAME (12) -
$ RS (12) -
$ ` (12) -
$ stdin (12) -
$ stdout (12) -
$ topdir (12) -
$ ~ (12) - % (12)
-
AI
_ V4MAPPED _ CFG (24) - ARGF (12)
- Array (12)
- BigDecimal (14)
- Complex (36)
- Continuation (12)
- DATA (12)
- DelegateClass (12)
- Digest (12)
- Float (12)
- Integer (12)
- JSON (12)
-
NEWS for Ruby 2
. 4 . 0 (9) -
NEWS for Ruby 2
. 5 . 0 (8) -
NEWS for Ruby 2
. 7 . 0 (6) -
NEWS for Ruby 3
. 0 . 0 (5) -
NEWS for Ruby 3
. 1 . 0 (4) - Pathname (24)
- Proc (12)
-
Profiler
_ _ (6) - Rational (7)
- Rubyの起動 (12)
-
SCRIPT
_ LINES _ _ (12) -
SO
_ ATTACH _ FILTER (24) -
SO
_ DETACH _ FILTER (24) - String (12)
- TracePoint (12)
- Win32ネイティブ版Rubyの互換性問題 (12)
- [] (18)
-
_ _ callee _ _ (12) -
_ _ method _ _ (12) - abort (24)
-
add
_ filter (12) -
add
_ trace _ func (12) - ancestors (12)
-
at
_ exit (12) - autoload (24)
- autoload? (12)
- bigdecimal (12)
- binding (12)
- binread (12)
- binwrite (12)
- caller (36)
-
caller
_ locations (24) - catch (24)
-
cc
_ command (12) -
check
_ signedness (24) -
check
_ sizeof (24) - chomp (12)
- chop (12)
- class (12)
-
class
_ eval (24) -
const
_ defined? (12) - constants (24)
-
convertible
_ int (24) - cp (12)
- create (22)
-
create
_ makefile (12) -
create
_ tmpsrc (12) -
def
_ exception (6) -
defined
_ class (12) -
depend
_ rules (12) - desc (12)
-
drb
/ extservm (12) -
egrep
_ cpp (24) - eval (36)
- exception (24)
- exec (48)
- execute (12)
- exit (24)
- exit! (12)
- fail (36)
-
find
_ executable (12) -
find
_ header (12) -
find
_ library (24) -
find
_ type (24) -
for
_ fd (12) - foreach (24)
- fork (24)
- format (12)
- freeze (12)
- getpty (24)
- gets (39)
-
global
_ variables (12) - gsub (36)
-
have
_ header (24) -
have
_ macro (24) -
have
_ struct _ member (24) -
have
_ type (24) - help (12)
- hex (12)
- httpd (12)
- identical? (12)
- import (12)
- include (12)
- inspect (12)
- install (12)
-
install
_ files (12) -
instance
_ eval (24) -
instance
_ variables (12) - irb (12)
-
irb
/ xmp (12) - j (12)
- kill (24)
- libpathflag (12)
-
link
_ command (12) - load (12)
-
local
_ variables (12) - log (12)
- loop (24)
- method (12)
- mkdir (12)
-
module
_ eval (24) - namespace (12)
- new (80)
- oct (12)
- open (174)
- open-uri (6)
-
open
_ uri (24) - p (12)
- path (12)
- popen (168)
- popen3 (24)
- pp (24)
-
pretty
_ print (24) - print (72)
- printf (84)
- proc (19)
-
psych
_ y (12) -
public
_ instance _ method (12) - putc (48)
- puts (60)
- raise (48)
-
rb
_ exec _ end _ proc (12) -
rb
_ load (12) - read (36)
- readline (12)
- readlines (48)
- rect (12)
- rectangular (12)
-
remove
_ const (12) - reopen (60)
- require (12)
-
require
_ relative (12) - rmdir (12)
-
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 2 feature (12) -
ruby 1
. 8 . 4 feature (12) -
ruby 1
. 9 feature (12) -
run
_ config (6) - sample (48)
- scanf (12)
- select (24)
- send (24)
-
set
_ trace _ func (24) -
setup
_ argv (1) - skip (1)
- sleep (24)
- spawn (84)
- sprintf (12)
- sprintf フォーマット (12)
- srand (24)
- status (12)
- sub (24)
- sysopen (12)
- system (48)
- tag (11)
- terminate (12)
- test (42)
-
to
_ a (12) -
to
_ ary (12) -
to
_ f (12) -
to
_ i (12) -
to
_ int (12) -
to
_ str (12) -
trace
_ var (36) - trap (24)
-
try
_ compile (24) -
try
_ constant (24) -
try
_ cpp (24) -
try
_ do (24) -
try
_ link (24) -
try
_ run (24) -
try
_ static _ assert (24) -
try
_ type (24) -
untrace
_ var (12) - value (11)
- warn (8)
-
webrick
/ https (12) -
webrick
/ httpservlet (12) -
with
_ werror (24) - write (24)
- xmp (12)
- xpopen (24)
- xsystem (12)
- y (12)
- このマニュアルのヘルプ (12)
- クラス/メソッドの定義 (12)
- セキュリティモデル (12)
- 制御構造 (12)
- 変数と定数 (12)
- 手続きオブジェクトの挙動の詳細 (12)
- 環境変数 (12)
- 終了処理 (12)
検索結果
先頭5件
-
String
# hex -> Integer (66.0) -
文字列に 16 進数で数値が表現されていると解釈して整数に変換します。 接頭辞 "0x", "0X" とアンダースコアは無視されます。 文字列が [_0-9a-fA-F] 以外の文字を含むときはその文字以降を無視します。
...//emlist[例][ruby]{
p "10".hex # => 16
p "ff".hex # => 255
p "0x10".hex # => 16
p "-0x10".hex # => -16
p "xyz".hex # => 0
p "10z".hex # => 16
p "1_0".hex # => 16
p "".hex # => 0
//}
@see String#oct, String#to_i, String#to_f,
Kernel.#Integer, Kernel.#Float
このメソ......ッドの逆に数値を文字列に変換するには
Kernel.#sprintf, String#%,
Integer#to_s
などを使ってください。... -
String
# scanf(format) -> Array (66.0) -
ブロックを指定しない場合、見つかった文字列を format に従って変 換し、そのオブジェクトの配列を返します。 format で指定した文字列が見つからない場合は空の配列を 生成して返します。
...指定した文字列が見つからない場合は空の配列を
生成して返します。
require 'scanf'
str = "123 abc 456 def 789 ghi"
p str.scanf("%d%s") #=> [123, "abc"]
ブロックを指定した場合は scanf を継続して実行し、順次
見つかった文字列を変換......0x90"
p str.scanf("%d%x"){|n, s| [n, s]}
#=> [[123, 69], [678, 144]]
formatに完全にマッチしていなくても、部分的にマッチしていれば、
ブロックは実行されます。
require 'scanf'
str = "123 abc 456 def"
ret = str.scanf("%s%d") { |s, n| [s, n] }
p ret......il], ["abc", 456], ["def", nil]]
@param format スキャンするフォーマットを文字列で指定します。
詳細は、m:String#scanf#format を参照してください。
使用例:
require 'scanf'
str = "123 abc 456 def 789 ghi"
p str.scanf("%d%s") #=> [123, "abc"]... -
String
# scanf(format) {|*ary| . . . } -> Array (66.0) -
ブロックを指定しない場合、見つかった文字列を format に従って変 換し、そのオブジェクトの配列を返します。 format で指定した文字列が見つからない場合は空の配列を 生成して返します。
...指定した文字列が見つからない場合は空の配列を
生成して返します。
require 'scanf'
str = "123 abc 456 def 789 ghi"
p str.scanf("%d%s") #=> [123, "abc"]
ブロックを指定した場合は scanf を継続して実行し、順次
見つかった文字列を変換......0x90"
p str.scanf("%d%x"){|n, s| [n, s]}
#=> [[123, 69], [678, 144]]
formatに完全にマッチしていなくても、部分的にマッチしていれば、
ブロックは実行されます。
require 'scanf'
str = "123 abc 456 def"
ret = str.scanf("%s%d") { |s, n| [s, n] }
p ret......il], ["abc", 456], ["def", nil]]
@param format スキャンするフォーマットを文字列で指定します。
詳細は、m:String#scanf#format を参照してください。
使用例:
require 'scanf'
str = "123 abc 456 def 789 ghi"
p str.scanf("%d%s") #=> [123, "abc"]... -
Shell
# [](command , file1 , file2 = nil) -> bool | Time | Integer | nil (58.0) -
Kernel.#test や FileTest のメソッドに処理を委譲します。
...
Kernel.#test や FileTest のメソッドに処理を委譲します。
@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。
@para......。
@param file2 文字列でファイルへのパスを指定します。
require 'shell'
Shell.verbose = false
sh = Shell.new
begin
sh.mkdir("foo")
rescue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e", "foo"] # => true
p sh[:exist......s?, "foo"] # => true
p sh["exists?", "foo"] # => true
@see Kernel.#test, FileTest... -
Shell
# test(command , file1 , file2 = nil) -> bool | Time | Integer | nil (58.0) -
Kernel.#test や FileTest のメソッドに処理を委譲します。
...
Kernel.#test や FileTest のメソッドに処理を委譲します。
@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。
@para......。
@param file2 文字列でファイルへのパスを指定します。
require 'shell'
Shell.verbose = false
sh = Shell.new
begin
sh.mkdir("foo")
rescue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e", "foo"] # => true
p sh[:exist......s?, "foo"] # => true
p sh["exists?", "foo"] # => true
@see Kernel.#test, FileTest... -
Shell
:: Filter # [](command , file1 , file2 = nil) -> bool | Time | Integer | nil (58.0) -
Kernel.#test や FileTest のメソッドに処理を委譲します。
...
Kernel.#test や FileTest のメソッドに処理を委譲します。
@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。
@para......。
@param file2 文字列でファイルへのパスを指定します。
require 'shell'
Shell.verbose = false
sh = Shell.new
begin
sh.mkdir("foo")
rescue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e", "foo"] # => true
p sh[:exist......s?, "foo"] # => true
p sh["exists?", "foo"] # => true
@see Kernel.#test, FileTest... -
Shell
:: Filter # test(command , file1 , file2 = nil) -> bool | Time | Integer | nil (58.0) -
Kernel.#test や FileTest のメソッドに処理を委譲します。
...
Kernel.#test や FileTest のメソッドに処理を委譲します。
@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。
@para......。
@param file2 文字列でファイルへのパスを指定します。
require 'shell'
Shell.verbose = false
sh = Shell.new
begin
sh.mkdir("foo")
rescue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e", "foo"] # => true
p sh[:exist......s?, "foo"] # => true
p sh["exists?", "foo"] # => true
@see Kernel.#test, FileTest... -
Object
# freeze -> self (48.0) -
オブジェクトを凍結(内容の変更を禁止)します。
...数なら Kernel.#trace_var が使えます。
@return self を返します。
//emlist[][ruby]{
a1 = "foo".freeze
a1 = "bar"
p a1 #=> "bar"
a2 = "foo".freeze
a2.replace("bar") # can't modify frozen String (RuntimeError)
//}
凍結を解除することはできませんが、Object#dup を使え......ます。
//emlist[][ruby]{
a = [1].freeze
p a.frozen? #=> true
a[0] = "foo"
p a # can't modify frozen Array (RuntimeError)
b = a.dup
p b #=> [1]
p b.frozen? #=> false
b[0] = "foo"
p b #=> ["foo"]
//}
@see Object#frozen?,Object#dup,Kernel.#trace_var......数なら Kernel.#trace_var が使えます。
@return self を返します。
//emlist[][ruby]{
a1 = "foo".freeze
a1 = "bar"
p a1 #=> "bar"
a2 = "foo".freeze
a2.replace("bar") # can't modify frozen String (FrozenError)
//}
凍結を解除することはできませんが、Object#dup を使え......ます。
//emlist[][ruby]{
a = [1].freeze
p a.frozen? #=> true
a[0] = "foo"
p a # can't modify frozen Array (FrozenError)
b = a.dup
p b #=> [1]
p b.frozen? #=> false
b[0] = "foo"
p b #=> ["foo"]
//}
@see Object#frozen?,Object#dup,Kernel.#trace_var... -
StringIO
. new(string = & # 39;& # 39; , mode = & # 39;r+& # 39;) -> StringIO (48.0) -
StringIO オブジェクトを生成して返します。
...ます。
@param string 生成される StringIO のデータを文字列で指定します。
この文字列はバッファとして使われます。StringIO#write などによって、
string 自身も書き換えられます。
@param mode Kernel.#open 同様文字......][ruby]{
require 'stringio'
s = "foo"
io = StringIO.new(s)
p io.getc # => 102
p io.pos # => 1
p io.size # => 3
io << "bar"
p io.size # => 4
p s # => "fbar"
io.rewind
p io.gets # => "fbar"
StringIO.open("hoge"){|io|
p io.string # => "hoge"
}
//}... -
Module
# autoload(const _ name , feature) -> nil (46.0) -
定数 const_name を最初に参照した時に feature を Kernel.#require するように設定します。
...定数 const_name を最初に参照した時に feature を Kernel.#require するように設定します。
const_name が autoload 設定されていて、まだ定義されてない(ロードされていない)ときは、
autoload する対象を置き換えます。
const_name が(autoload......しません。
@param const_name String または Symbol で指定します。
なお、const_name には、"::" 演算子を含めることはできません。
つまり、self の直下に定義された定数しか指定できません。
@param feature Kernel.#require と同様......tmp/foo.rb ---------
class Foo
class Bar
end
end
# ----- end of /tmp/foo.rb ----
class Foo
autoload :Bar, '/tmp/foo'
end
p Foo::Bar #=> Foo::Bar
//}
以下のようにモジュールを明示的にレシーバとして呼び出すこともできます。
//emlist[例][ruby]{
# ------- /tmp/... -
NEWS for Ruby 2
. 5 . 0 (42.0) -
NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...の更新
* Array
* Array#append を追加 12746
* Array#prepend を追加 12746
* Data
* 非推奨になりました。C拡張のベースクラスでしたが、Rubyレベルに公開するのをやめました。3072
* Exception
* Exception#full_message を追加 14141 [......というキーワード引数を追加しました 13056
* Dir.chdir (ブロックなしで呼び出した場合), Dir.open, Dir.new, Dir.mkdir, Dir.rmdir,
Dir.empty? はGVLを解放するようになりました
* Dir.children を追加 11302
* Dir.each_child を追加 11302......を受け取ることができるようになりました 11286
* File
* File.open :newline オプションを指定するとテキストモードになります 13350
* File#path はFile::Constants::TMPFILE付きで開いたファイルに対して IOError を発生させます
135... -
Object
# class -> Class (42.0) -
レシーバのクラスを返します。
...レシーバのクラスを返します。
//emlist[][ruby]{
p "ruby".class #=> String
p 100.class #=> Integer
p ARGV.class #=> Array
p self.class #=> Object
p Class.class #=> Class
p Kernel.class #=> Module
//}
@see Class#superclass,Object#kind_of?,Object#instance_of?...