るりまサーチ

最速Rubyリファレンスマニュアル検索!
1147件ヒット [201-300件を表示] (0.194秒)

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

クラス

検索結果

<< < 1 2 3 4 5 ... > >>

ARGF.class#gets(rs, limit, chomp: false) -> String | nil (9264.0)

ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。

...ド)。

@param limit 最大の読み込みバイト数

@param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets...
... test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets(2) # => "li"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.t...
...xt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("") # => "line1\nline2\nline3\n\n"

@see Kernel.#gets, IO#gets, ARGF.class#getbyte, ARGF.class#getc...

ARGF.class#getc -> String | nil (9226.0)

self から 1 文字読み込んで返します。EOF に到達した時には nil を返します。

...f から 1 文字読み込んで返します。EOF に到達した時には nil を返します。

ARGF はスクリプトに指定した引数(Object::ARGV を参照) をファイル名
とみなして、それらのファイルを連結した 1 つの仮想ファイルを表すオブジェ
クト...
...foo" > file1
$ echo "bar" > file2
$ ruby argf.rb file1 file2

ARGF.getc # => "f"
ARGF.getc # => "o"
ARGF.getc # => "o"
ARGF.getc # => "\n"
ARGF.getc # => "b"
ARGF.getc # => "a"
ARGF.getc # => "r"
ARGF.getc # => "\n"
ARGF.getc # => nil

@see ARGF.class#getbyte, ARGF.class#gets...

Thread::Backtrace::Location#absolute_path -> String (9220.0)

self が表すフレームの絶対パスを返します。

...list[例][ruby]{
# foo.rb
class
Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end

Foo.new(0..2).locations.map do |call|
puts call.absolute_path
end

# => /path/to/foo.rb
# /path/to/foo.rb
# /path/to/foo.rb
//}

@see Thread::Backtrace::Location...
...#path...

FalseClass#inspect -> String (9215.0)

常に文字列 "false" を返します。

...常に文字列 "false" を返します。

//emlist[例][ruby]{
false.to_s # => "false"
//}...

FalseClass#to_s -> String (9215.0)

常に文字列 "false" を返します。

...常に文字列 "false" を返します。

//emlist[例][ruby]{
false.to_s # => "false"
//}...

絞り込み条件を変える

NilClass#to_s -> String (9214.0)

空文字列 "" を返します。

...空文字列 "" を返します。

//emlist[例][ruby]{
nil.to_s # => ""
//}...

TrueClass#inspect -> String (9214.0)

常に文字列 "true" を返します。

...常に文字列 "true" を返します。

//emlist[例][ruby]{
t
rue.inspect # => "true"
//}...

TrueClass#to_s -> String (9214.0)

常に文字列 "true" を返します。

...常に文字列 "true" を返します。

//emlist[例][ruby]{
t
rue.to_s # => "true"
//}...

Thread#backtrace -> [String] | nil (6320.0)

スレッドの現在のバックトレースを返します。

...ist[例][ruby]{
class
C1
def m1
sleep 5
end
def m2
m1
end
end

t
h = Thread.new {C1.new.m2; Thread.stop}
t
h.backtrace
# => [
# [0] "(irb):3:in `sleep'",
# [1] "(irb):3:in `m1'",
# [2] "(irb):6:in `m2'",
# [3] "(irb):10:in `block in irb_binding'"
# ]

t
h.kill
t
h....
...backtrace # => nil
//}...
<< < 1 2 3 4 5 ... > >>