るりまサーチ

最速Rubyリファレンスマニュアル検索!
536件ヒット [1-100件を表示] (0.027秒)

別のキーワード

  1. kernel $fs
  2. kernel $5
  3. kernel $4
  4. kernel $7
  5. kernel $6

検索結果

<< 1 2 3 ... > >>

Kernel$$OFS -> String | nil (24208.0)

$, の別名

...
$
, の別名

require "English"

array = %w|hoge fuga ugo bar foo|
p array.join #=> "hogefugaugobarfoo"
$
OUTPUT_FIELD_SEPARATOR = ","
p array.join #=> "hoge,fuga,ugo,bar,foo"...

Kernel$$OUTPUT_FIELD_SEPARATOR -> String | nil (21108.0)

$, の別名

...
$
, の別名

require "English"

array = %w|hoge fuga ugo bar foo|
p array.join #=> "hogefugaugobarfoo"
$
OUTPUT_FIELD_SEPARATOR = ","
p array.join #=> "hoge,fuga,ugo,bar,foo"...

RubyVM::InstructionSequence.of(body) -> RubyVM::InstructionSequence (18143.0)

引数 body で指定した Proc、Method オブジェクトを元に RubyVM::InstructionSequence オブジェクトを作成して返します。

...

# proc
> p = proc { num = 1 + 2 }
> RubyVM::InstructionSequence.of(p)
> # => <RubyVM::InstructionSequence:block in irb_binding@(irb)>

# method
> def foo(bar); puts bar; end
> RubyVM::InstructionSequence.of(method(:foo))
> # => <RubyVM::InstructionSequence:foo@(irb)>

例2: Ruby...
...orld"
end

$
a_global_proc = proc { str = 'a' + 'b' }

# irb
> require '/tmp/iseq_of.rb'

# hello メソッド
> RubyVM::InstructionSequence.of(method(:hello))
> # => #<RubyVM::InstructionSequence:0x007fb73d7cb1d0>

# グローバル proc
> RubyVM::InstructionSequence.of($a_global_p...

Kernel$$INPUT_LINE_NUMBER -> Integer (18120.0)

$. の別名

...
$
. の別名

1 e
2 f
3 g
4 h
5 i
# end of a.txt

require "English"

File.foreach(ARGV.at(0)){|line|
# read line
}
p $INPUT_LINE_NUMBER
# end of sample.rb

ruby sample.rb a.txt
#=> 5...

Kernel$$NR -> Integer (18120.0)

$. の別名

...
$
. の別名

1 e
2 f
3 g
4 h
5 i
# end of a.txt

require "English"

File.foreach(ARGV.at(0)){|line|
# read line
}
p $INPUT_LINE_NUMBER
# end of sample.rb

ruby sample.rb a.txt
#=> 5...

絞り込み条件を変える

Kernel$$ORS -> String | nil (18114.0)

$\ の別名

...
$
\ の別名

require "English"

print "hoge\nhuga\n"
$
OUTPUT_RECORD_SEPARATOR = "\n"
print "fuge"
print "ugo"
# end of sample.rb

ruby sample.rb
hoge
huga
fuge
ugo...

Kernel$$OUTPUT_RECORD_SEPARATOR -> String | nil (18114.0)

$\ の別名

...
$
\ の別名

require "English"

print "hoge\nhuga\n"
$
OUTPUT_RECORD_SEPARATOR = "\n"
print "fuge"
print "ugo"
# end of sample.rb

ruby sample.rb
hoge
huga
fuge
ugo...

Kernel$$ARGV -> [String] (18113.0)

$* の別名

...
$
* の別名

require "English"
p $ARGV
# end of sample.rb

ruby sample.rb 31 /home/hoge/fuga.txt
#=> ["31", "/home/hoge/fuga.txt"]...

Kernel$$DEFAULT_INPUT -> IO (18113.0)

$< の別名

...
$
< の別名

require "English"
while line = $DEFAULT_INPUT.gets
p line
end
# end of sample.rb

ruby sample.rb < /etc/passwd
# => "hoge:x:500:501::/home/hoge:/bin/bash\n"
......
<< 1 2 3 ... > >>