 :Kernel.#p
:Kernel.#p![条件を削除 [x]](/images/drop-condition-icon.png) >
 >  :Array
:Array![条件を削除 [x]](/images/drop-condition-icon.png) >
 >  :public_instance_method
:public_instance_method![条件を削除 [x]](/images/drop-condition-icon.png) >
 >  :lambda
:lambda![条件を削除 [x]](/images/drop-condition-icon.png) >
 >  :method
:method![条件を削除 [x]](/images/drop-condition-icon.png) >
 >  :cpp_command
:cpp_command![条件を削除 [x]](/images/drop-condition-icon.png) >
 >  :help
:help![条件を削除 [x]](/images/drop-condition-icon.png) >
 >  :include
:include![条件を削除 [x]](/images/drop-condition-icon.png) >
 >  :ビルトイン
:ビルトイン![条件を削除 [x]](/images/drop-condition-icon.png) 
  クラス
- 
        ARGF. class (75) 
- Array (48)
- BasicObject (24)
- Binding (12)
- Complex (24)
- Exception (24)
- File (36)
- IO (468)
- LoadError (12)
- Module (144)
- Object (156)
- Proc (19)
- String (60)
- SystemExit (12)
- Thread (72)
- TracePoint (12)
- UncaughtThrowError (22)
キーワード
- 
        $ ! (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) 
- 
        $ LOAD _ PATH (12) 
- 
        $ PROGRAM _ NAME (12) 
- 
        $ ` (12) 
- 
        $ stdin (12) 
- 
        $ stdout (12) 
- 
        $ ~ (12) 
- % (12)
- ARGF (12)
- Complex (36)
- DATA (12)
- Float (12)
- Integer (12)
- Proc (12)
- Rational (7)
- 
        SCRIPT_ LINES _ _ (12) 
- String (12)
- TracePoint (12)
- 
        _ _ callee _ _ (12) 
- 
        _ _ method _ _ (12) 
- abort (24)
- 
        add_ trace _ func (12) 
- ancestors (12)
- 
        at_ exit (12) 
- autoload (24)
- autoload? (12)
- binding (12)
- binread (12)
- binwrite (12)
- caller (36)
- 
        caller_ locations (24) 
- catch (24)
- chomp (12)
- chop (12)
- class (12)
- 
        class_ eval (24) 
- 
        const_ defined? (12) 
- constants (24)
- 
        defined_ class (12) 
- eval (36)
- exception (24)
- exec (48)
- exit (24)
- exit! (12)
- fail (36)
- 
        for_ fd (12) 
- foreach (24)
- fork (24)
- format (12)
- freeze (12)
- gets (39)
- 
        global_ variables (12) 
- gsub (36)
- hex (12)
- identical? (12)
- inspect (12)
- 
        instance_ eval (24) 
- 
        instance_ variables (12) 
- kill (24)
- load (12)
- 
        local_ variables (12) 
- loop (24)
- 
        module_ eval (24) 
- new (43)
- oct (12)
- open (72)
- p (12)
- path (12)
- popen (168)
- pp (8)
- print (36)
- printf (48)
- proc (19)
- putc (36)
- puts (36)
- raise (48)
- read (36)
- readline (12)
- readlines (48)
- rect (12)
- rectangular (12)
- 
        remove_ const (12) 
- reopen (36)
- 
        require_ relative (12) 
- sample (48)
- select (24)
- send (24)
- 
        set_ trace _ func (24) 
- sleep (24)
- spawn (60)
- sprintf (12)
- srand (24)
- status (12)
- sub (24)
- sysopen (12)
- system (48)
- tag (11)
- terminate (12)
- test (24)
- 
        to_ a (12) 
- 
        to_ ary (12) 
- 
        to_ f (12) 
- 
        to_ i (12) 
- 
        to_ int (12) 
- 
        to_ str (12) 
- 
        trace_ var (36) 
- trap (24)
- 
        untrace_ var (12) 
- value (11)
- warn (8)
- write (24)
検索結果
先頭5件
- 
      Kernel. # p(*arg) -> object | Array (39133.0) 
- 
      
      
      引数を人間に読みやすい形に整形して改行と順番に標準出力 $stdout に出力します。主にデバッグに使用します。 ...使用します。
 引数の inspect メソッドの返り値と改行を順番に出力します。つまり以下のコードと同じです。
 //emlist[例][ruby]{
 print arg[0].inspect, "\n", arg[1].inspect, "\n" #, ...
 //}
 整形に用いられるObject#inspectは普通に文字列に変換......別がつかなくなるようなクラス間の差異も表現できるように工夫されています。
 p に引数を与えずに呼び出した場合は特に何もしません。
 @param arg 出力するオブジェクトを任意個指定します。
 @raise IOError 標準出力が書き込......された引数 arg を返します。複数の引数が指定された場合はそれらを要素とする配列を返します。
 //emlist[例][ruby]{
 puts "" #=> (空行)
 p "" #=> ""
 puts 50,"50"
 #=> 50
 #=> 50
 p 50,"50"
 #=> 50
 #=> "50"
 //}
 @see Object#inspect,Kernel.#puts,Kernel.#print...
- 
      Kernel. # Complex(r , i = 0) -> Complex (27202.0) 
- 
      
      
      実部が r、虚部が i である Complex クラスのオブジェクトを生成します。 ...実部が r、虚部が i である Complex クラスのオブジェクトを生成します。
 @param r 生成する複素数の実部。
 @param i 生成する複素数の虚部。省略した場合は 0 です。
 @param s 生成する複素数を表す文字列。
 @raise ArgumentError 変換......生します。
 //emlist[例][ruby]{
 Complex(1) # => (1+0i)
 Complex(1, 2) # => (1+2i)
 Complex('1+1i') # => (1+1i)
 Complex('1+1j') # => (1+1i)
 # Complex.polar(10, 10) と同一。
 Complex('10@10') # => (-8.390715290764524-5.440211108893697i)
 Complex('_') # => ArgumentError
 //}
 r に......Complex(a, b) を a+bi として計算した Complex オブジェクトを返しま
 す。
 //emlist[例][ruby]{
 Complex('1+1i', '2+3i') # => (-2+3i)
 Complex('1+1i') + Complex('2+3i') * Complex('i') # => (-2+3i)
 //}
 @see Complex.rect、Complex.rectangular
 [注意] Complex...
- 
      Kernel. # Complex(r , i = 0 , exception: true) -> Complex | nil (27202.0) 
- 
      
      
      実部が r、虚部が i である Complex クラスのオブジェクトを生成します。 ...、虚部が i である Complex クラスのオブジェクトを生成します。
 @param r 生成する複素数の実部。
 @param i 生成する複素数の虚部。省略した場合は 0 です。
 @param s 生成する複素数を表す文字列。
 @param exception false を指定する......生します。
 //emlist[例][ruby]{
 Complex(1) # => (1+0i)
 Complex(1, 2) # => (1+2i)
 Complex('1+1i') # => (1+1i)
 Complex('1+1j') # => (1+1i)
 # Complex.polar(10, 10) と同一。
 Complex('10@10') # => (-8.390715290764524-5.440211108893697i)
 Complex('_') # => ArgumentError
 //}
 r に......Complex(a, b) を a+bi として計算した Complex オブジェクトを返しま
 す。
 //emlist[例][ruby]{
 Complex('1+1i', '2+3i') # => (-2+3i)
 Complex('1+1i') + Complex('2+3i') * Complex('i') # => (-2+3i)
 //}
 @see Complex.rect、Complex.rectangular
 [注意] Complex...
- 
      Kernel. # Complex(s) -> Complex (27202.0) 
- 
      
      
      実部が r、虚部が i である Complex クラスのオブジェクトを生成します。 ...実部が r、虚部が i である Complex クラスのオブジェクトを生成します。
 @param r 生成する複素数の実部。
 @param i 生成する複素数の虚部。省略した場合は 0 です。
 @param s 生成する複素数を表す文字列。
 @raise ArgumentError 変換......生します。
 //emlist[例][ruby]{
 Complex(1) # => (1+0i)
 Complex(1, 2) # => (1+2i)
 Complex('1+1i') # => (1+1i)
 Complex('1+1j') # => (1+1i)
 # Complex.polar(10, 10) と同一。
 Complex('10@10') # => (-8.390715290764524-5.440211108893697i)
 Complex('_') # => ArgumentError
 //}
 r に......Complex(a, b) を a+bi として計算した Complex オブジェクトを返しま
 す。
 //emlist[例][ruby]{
 Complex('1+1i', '2+3i') # => (-2+3i)
 Complex('1+1i') + Complex('2+3i') * Complex('i') # => (-2+3i)
 //}
 @see Complex.rect、Complex.rectangular
 [注意] Complex...
- 
      Kernel. # Complex(s , exception: true) -> Complex | nil (27202.0) 
- 
      
      
      実部が r、虚部が i である Complex クラスのオブジェクトを生成します。 ...、虚部が i である Complex クラスのオブジェクトを生成します。
 @param r 生成する複素数の実部。
 @param i 生成する複素数の虚部。省略した場合は 0 です。
 @param s 生成する複素数を表す文字列。
 @param exception false を指定する......生します。
 //emlist[例][ruby]{
 Complex(1) # => (1+0i)
 Complex(1, 2) # => (1+2i)
 Complex('1+1i') # => (1+1i)
 Complex('1+1j') # => (1+1i)
 # Complex.polar(10, 10) と同一。
 Complex('10@10') # => (-8.390715290764524-5.440211108893697i)
 Complex('_') # => ArgumentError
 //}
 r に......Complex(a, b) を a+bi として計算した Complex オブジェクトを返しま
 す。
 //emlist[例][ruby]{
 Complex('1+1i', '2+3i') # => (-2+3i)
 Complex('1+1i') + Complex('2+3i') * Complex('i') # => (-2+3i)
 //}
 @see Complex.rect、Complex.rectangular
 [注意] Complex...
- 
      Kernel. # open(file , mode _ enc = "r" , perm = 0666) -> IO (27202.0) 
- 
      
      
      file をオープンして、IO(Fileを含む)クラスのインスタンスを返します。 ...である時、open は Ruby の子プロセス
 を生成し、その子プロセスとの間のパイプ(IOオブジェクト)を返し
 ます。(このときの動作は、IO.popen と同じです。
 File.open にはパイプラインを生成する機能はありません)。
 Perlと異なり......ます。
 @param file ファイルを文字列で指定します。整数を指定した場合はファイルディスクリプタとして扱います。
 @param mode_enc モード・エンコーディングを文字列か定数の論理和で指定します。後述。
 @param perm open(2) の第 3......ョンを整数で指定します。
 @raise Errno::EXXX ファイルのオープンに失敗した場合に発生します。
 @see File.open,IO.popen,IO.open
 === 第二引数のオープンモード・エンコーディング
 文字列("mode" か "mode:ext_enc" か "mode:ext_enc:int_enc" とい...
- 
      Kernel. # open(file , mode _ enc = "r" , perm = 0666) {|io| . . . } -> object (27202.0) 
- 
      
      
      file をオープンして、IO(Fileを含む)クラスのインスタンスを返します。 ...である時、open は Ruby の子プロセス
 を生成し、その子プロセスとの間のパイプ(IOオブジェクト)を返し
 ます。(このときの動作は、IO.popen と同じです。
 File.open にはパイプラインを生成する機能はありません)。
 Perlと異なり......ます。
 @param file ファイルを文字列で指定します。整数を指定した場合はファイルディスクリプタとして扱います。
 @param mode_enc モード・エンコーディングを文字列か定数の論理和で指定します。後述。
 @param perm open(2) の第 3......ョンを整数で指定します。
 @raise Errno::EXXX ファイルのオープンに失敗した場合に発生します。
 @see File.open,IO.popen,IO.open
 === 第二引数のオープンモード・エンコーディング
 文字列("mode" か "mode:ext_enc" か "mode:ext_enc:int_enc" とい...
- 
      Kernel. # spawn(env , program , *args , options={}) -> Integer (27134.0) 
- 
      
      
      引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。 ...す。
 //emlist[例][ruby]{
 # FOO を BAR にして BAZ を削除する
 pid = spawn({"FOO"=>"BAR", "BAZ"=>nil}, command)
 //}
 親プロセスは Process.#waitpid で子プロセスの終了を待ち合わせるか
 もしくは Process.#detach で子プロセスを切り離すかしてください。......残る場合があります。
 === 引数の解釈
 この形式で呼び出した場合、空白や shell のメタキャラクタも
 そのまま program の引数に渡されます。
 先頭の引数が2要素の配列であった場合、第1要素の文字列が実際に
 起動するプログ......け」のプロ
 グラム名になります。
 また、第1要素はフルパスで指定しなくても環境変数 PATH から探します。
 === option引数の概要
 Hash を options として渡すことで、起動される子プロセスの
 * プロセスグループ
 * resource limit...
- 
      Kernel. # spawn(program , *args) -> Integer (27134.0) 
- 
      
      
      引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。 ...す。
 //emlist[例][ruby]{
 # FOO を BAR にして BAZ を削除する
 pid = spawn({"FOO"=>"BAR", "BAZ"=>nil}, command)
 //}
 親プロセスは Process.#waitpid で子プロセスの終了を待ち合わせるか
 もしくは Process.#detach で子プロセスを切り離すかしてください。......残る場合があります。
 === 引数の解釈
 この形式で呼び出した場合、空白や shell のメタキャラクタも
 そのまま program の引数に渡されます。
 先頭の引数が2要素の配列であった場合、第1要素の文字列が実際に
 起動するプログ......け」のプロ
 グラム名になります。
 また、第1要素はフルパスで指定しなくても環境変数 PATH から探します。
 === option引数の概要
 Hash を options として渡すことで、起動される子プロセスの
 * プロセスグループ
 * resource limit...
- 
      Kernel. # spawn(env , program , *args , options={}) -> Integer (27128.0) 
- 
      
      
      引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。 ...す。
 //emlist[例][ruby]{
 # FOO を BAR にして BAZ を削除する
 pid = spawn({"FOO"=>"BAR", "BAZ"=>nil}, command)
 //}
 親プロセスは Process.#waitpid で子プロセスの終了を待ち合わせるか
 もしくは Process.#detach で子プロセスを切り離すかしてください。......残る場合があります。
 === 引数の解釈
 この形式で呼び出した場合、空白や shell のメタキャラクタも
 そのまま program の引数に渡されます。
 先頭の引数が2要素の配列であった場合、第1要素の文字列が実際に
 起動するプログ......け」のプロ
 グラム名になります。
 また、第1要素はフルパスで指定しなくても環境変数 PATH から探します。
 === option引数の概要
 Hash を options として渡すことで、起動される子プロセスの
 * プロセスグループ
 * resource limit...
- 
      Kernel. # spawn(program , *args) -> Integer (27128.0) 
- 
      
      
      引数を外部コマンドとして実行しますが、生成した 子プロセスの終了を待ち合わせません。生成した子プロセスのプロセスIDを返します。 ...す。
 //emlist[例][ruby]{
 # FOO を BAR にして BAZ を削除する
 pid = spawn({"FOO"=>"BAR", "BAZ"=>nil}, command)
 //}
 親プロセスは Process.#waitpid で子プロセスの終了を待ち合わせるか
 もしくは Process.#detach で子プロセスを切り離すかしてください。......残る場合があります。
 === 引数の解釈
 この形式で呼び出した場合、空白や shell のメタキャラクタも
 そのまま program の引数に渡されます。
 先頭の引数が2要素の配列であった場合、第1要素の文字列が実際に
 起動するプログ......け」のプロ
 グラム名になります。
 また、第1要素はフルパスで指定しなくても環境変数 PATH から探します。
 === option引数の概要
 Hash を options として渡すことで、起動される子プロセスの
 * プロセスグループ
 * resource limit...
- 
      Kernel. # print(*arg) -> nil (27120.0) 
- 
      
      
      引数を順に標準出力 $stdout に出力します。引数が与えられない時には変数 $_ の値を出力します。 ...@param arg 出力するオブジェクトを任意個指定します。
 @raise IOError 標準出力が書き込み用にオープンされていなければ発生します。
 @raise Errno::EXXX 出力に失敗した場合に発生します。
 //emlist[例][ruby]{
 print "Hello, world!"
 print "Regexp......is",/ant/
 print nil
 print "\n"
 #=> Hello, world!Regexp is(?-mix:ant)
 $_ = "input"
 $, = "<and>"
 $\ = "<end>\n"
 print
 print "AA","BB"
 #=> input<end>
 #=> AA<and>BB<end>
 //}
 @see Kernel.#puts,Kernel.#p,IO#print...
- 
      Kernel. # puts(*arg) -> nil (27120.0) 
- 
      
      
      引数と改行を順番に 標準出力 $stdout に出力します。 引数がなければ改行のみを出力します。 ...ッドにより文字列へ変換を試みます。
 末尾が改行で終っている引数や配列の要素に対しては puts 自身
 は改行を出力しません。
 @param arg 出力するオブジェクトを任意個指定します。
 @raise IOError 標準出力が書き込み用にオー......に失敗した場合に発生します。
 //emlist[例][ruby]{
 puts "foo", "bar\n", "baz"
 puts "" # 改行のみ出力
 puts # 改行のみ出力
 puts nil # 改行のみ出力
 puts ["oui", "non"]
 #=> foo
 # bar
 # baz
 #
 #
 #
 # oui
 # non
 //}
 @see Kernel.#print, Kernel.#p, IO#puts...
