るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

モジュール

検索結果

<< < ... 6 7 8 >>

Module#<=>(other) -> Integer | nil (19.0)

self と other の継承関係を比較します。

...返します。

other がクラスやモジュールでなければ
nil を返します。

@
param other 比較対象のクラスやモジュール

//emlist[例][ruby]{
module Foo
end
class Bar
include
Foo
end
class Baz < Bar
end
class Qux
end
p Bar <=> Foo # => -1
p Baz <=> Bar # => -1...

Module#ancestors -> [Class, Module] (19.0)

クラス、モジュールのスーパークラスとインクルードしているモジュール を優先順位順に配列に格納して返します。

...先順位順に配列に格納して返します。

//emlist[例][ruby]{
module Foo
end
class Bar
include
Foo
end
class Baz < Bar
p ancestors
p included_modules
p superclass
end
# => [Baz, Bar, Foo, Object, Kernel, BasicObject]
# => [Foo, Kernel]
# => Bar
//}

@
see Module#included_modules...

Pathname#each_entry -> Enumerator (19.0)

Dir.foreach(self.to_s) {|f| yield Pathname.new(f) } と同じです。

...場合は Enumerator を返します。

//emlist[例][ruby]{
require "pathname"

Pathname("/usr/local").each_entry {|f| p f }

# => #<Pathname:.>
# => #<Pathname:..>
# => #<Pathname:bin>
# => #<Pathname:etc>
# => #<Pathname:include>
# => #<Pathname:lib>
# => #<Pathname:opt>
//}

@
see Dir.foreach...

Pathname#each_entry {|pathname| ... } -> nil (19.0)

Dir.foreach(self.to_s) {|f| yield Pathname.new(f) } と同じです。

...d Pathname.new(f) } と同じです。


//emlist[例][ruby]{
require "pathname"

Pathname("/usr/local").each_entry {|f| p f }

# => #<Pathname:.>
# => #<Pathname:..>
# => #<Pathname:bin>
# => #<Pathname:etc>
# => #<Pathname:include>
# => #<Pathname:lib>
# => #<Pathname:opt>
//}

@
see Dir.foreach...
...場合は Enumerator を返します。

//emlist[例][ruby]{
require "pathname"

Pathname("/usr/local").each_entry {|f| p f }

# => #<Pathname:.>
# => #<Pathname:..>
# => #<Pathname:bin>
# => #<Pathname:etc>
# => #<Pathname:include>
# => #<Pathname:lib>
# => #<Pathname:opt>
//}

@
see Dir.foreach...

REXML::StreamListener#entitydecl(content) -> () (19.0)

DTDの実体宣言をパースしたときに呼び出されるコールバックメソッドです。

...きに呼び出されるコールバックメソッドです。

@
param content 実体宣言が配列で渡されます

実体宣言の書き方によって content に渡されるデータの形式が異なります。

//emlist[][ruby]{
require 'rexml/parsers/baseparser'
require 'rexml/parsers/st...
...p://www.textuality.com/boilerplate/OpenHatch.xml">
<!ENTITY hatch-pic SYSTEM "../grafix/OpenHatch.gif" NDATA gif>
]>
<root />
EOS

class Listener
include
REXML::StreamListener
def entitydecl(content); p content; end
end
REXML::Parsers::StreamParser.new(xml, Listener.new).parse
# >> ["YN", "\"Yes...

絞り込み条件を変える

TSort#each_strongly_connected_component -> Enumerator (19.0)

TSort#strongly_connected_components メソッドのイテレータ版です。 obj.each_strongly_connected_component は obj.strongly_connected_components.each に似ていますが、 ブロックの評価中に obj が変更された場合は予期しない結果になる ことがあります。

...い結果になる
ことがあります。

each_strongly_connected_component は nil を返します。

//emlist[使用例][ruby]{
require 'tsort'

class Hash
include
TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end

non_sort = {...
...1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}

non_sort.each_strongly_connected_component{|nodes|
p nodes
}

#出力
#=> [4]
#=> [2, 3]
#=> [1]
//}

@
see TSort.each_strongly_connected_component...

TSort#each_strongly_connected_component {|nodes| ...} -> nil (19.0)

TSort#strongly_connected_components メソッドのイテレータ版です。 obj.each_strongly_connected_component は obj.strongly_connected_components.each に似ていますが、 ブロックの評価中に obj が変更された場合は予期しない結果になる ことがあります。

...い結果になる
ことがあります。

each_strongly_connected_component は nil を返します。

//emlist[使用例][ruby]{
require 'tsort'

class Hash
include
TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end

non_sort = {...
...1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}

non_sort.each_strongly_connected_component{|nodes|
p nodes
}

#出力
#=> [4]
#=> [2, 3]
#=> [1]
//}

@
see TSort.each_strongly_connected_component...

TSort#strongly_connected_components -> Array (19.0)

強連結成分の集まりを配列の配列として返します。 この配列は子から親に向かってソートされています。 各要素は強連結成分を表す配列です。

...使用例][ruby]{
require 'tsort'

class Hash
include
TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end

non_sort = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}

p non_sort.strongly_connected_components
#=> [[4], [2, 3], [1]]
//}

@
see TSort.s...

CSV::Row#header?(name) -> bool (14.0)

自身のヘッダに与えられた値が含まれている場合は真を返します。 そうでない場合は偽を返します。

...れている場合は真を返します。
そうでない場合は偽を返します。

@
param name この行のヘッダに含まれているかどうか調べたい値を指定します。

//emlist[例][ruby]{
require "csv"

row = CSV::Row.new(["header1", "header2"], [1, 2])
row.header?("header...
<< < ... 6 7 8 >>