るりまサーチ

最速Rubyリファレンスマニュアル検索!
237件ヒット [1-100件を表示] (0.159秒)
トップページ > クエリ:l[x] > クエリ:>[x] > クエリ:p[x] > クエリ:empty?[x] > 種類:インスタンスメソッド[x]

別のキーワード

  1. _builtin >
  2. bigdecimal >
  3. complex >
  4. module >
  5. integer >

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 3 > >>

REXML::Parsers::PullParser#empty? -> bool (30402.0)

未処理のイベントが残っていない場合に真を返します。

...未処理のイベントが残っていない場合に真を返します。

@see REXML::Parsers::PullParser#has_next?...

CSV::Table#empty? -> bool (27426.0)

ヘッダーを除いて、データがないときに true を返します。

...ーを除いて、データがないときに true を返します。

Array#empty? に委譲しています。

//emlist[][ruby]{
require 'csv'
csv = CSV.new("a,b\n", headers: true)
table = csv.read
p
table.empty? # => true
table << [1, 2]
p
table.empty? # => false
//}

@see Array#empty?...

Symbol#empty? -> bool (27414.0)

自身が :"" (length が 0 のシンボル)かどうかを返します。

...自身が :"" (length が 0 のシンボル)かどうかを返します。

:"".empty? #=> true
:foo.empty? #=> false

@see String#empty?...

REXML::Elements#empty? -> bool (27402.0)

子要素を持たない場合に true を返します。

子要素を持たない場合に true を返します。

REXML::Text#empty? -> bool (27402.0)

テキストが空ならば真を返します。

テキストが空ならば真を返します。

絞り込み条件を変える

ThreadsWait#empty? -> bool (24432.0)

同期されるスレッドが存在するならば true をかえします。

...ッドが存在するならば true をかえします。

使用例
require 'thwait'

threads = []
3.times {|i|
threads << Thread.new { sleep 1; p Thread.current }
}

thall = ThreadsWait.new
p
thall.threads.empty? #=> true
thall.join(*threads)
p
thall.threads.empty? #=> false...

Array#empty? -> bool (24426.0)

自身の要素の数が 0 の時に真を返します。そうでない場合に false を返します。

...自身の要素の数が 0 の時に真を返します。そうでない場合に false を返します。

//emlist[例][ruby]{
p
[].empty? #=> true
p
[1, 2, 3].empty? #=> false
//}...

Pathname#empty? -> bool (24426.0)

ディレクトリに対しては Dir.empty?(self.to_s) と同じ、他に対しては FileTest.empty?(self.to_s) と同じです。

...は Dir.empty?(self.to_s) と同じ、他に対しては FileTest.empty?(self.to_s) と同じです。

//emlist[例 ディレクトリの場合][ruby]{
require "pathname"
require 'tmpdir'

P
athname("/usr/local").empty? # => false
Dir.mktmpdir { |dir| Pathname(dir).empty? } # => true
/...
.../}

//emlist[例 ファイルの場合][ruby]{
require "pathname"
require 'tempfile'

P
athname("testfile").empty? # => false
Tempfile.create("tmp") { |tmp| Pathname(tmp).empty? } # => true
//}

@see Dir.empty?, FileTest.#empty?, Pathname#zero?...

Set#empty? -> bool (24426.0)

集合が要素を 1 つも持たないときに true を返します。

...集合が要素を 1 つも持たないときに true を返します。

//emlist[][ruby]{
require 'set'
p
Set[10, 20].empty? # => false
p
Set[].empty? # => true
//}...

String#empty? -> bool (24420.0)

文字列が空 (つまり長さ 0) の時、真を返します。

...文字列が空 (つまり長さ 0) の時、真を返します。

//emlist[例][ruby]{
"hello".empty? #=> false
" ".empty? #=> false
"".empty? #=> true
//}...

絞り込み条件を変える

<< 1 2 3 > >>