572件ヒット
[1-100件を表示]
(0.115秒)
クラス
-
ARGF
. class (60) - Array (24)
- Method (44)
- Module (96)
- NilClass (12)
- Object (48)
- OptionParser (144)
-
RubyVM
:: InstructionSequence (12) -
WEBrick
:: HTTPUtils :: FormData (24)
モジュール
- Enumerable (72)
- Kernel (12)
- TSort (24)
キーワード
- === (8)
- DelegateClass (12)
- [] (12)
- call (24)
- list (12)
- max (24)
- min (24)
- on (144)
-
pretty
_ print (12) -
pretty
_ print _ cycle (12) - private (48)
-
private
_ class _ method (24) -
public
_ class _ method (24) - readlines (24)
-
sort
_ by (24) -
strongly
_ connected _ components (12) -
to
_ a (72) -
to
_ ary (36) - tsort (12)
検索結果
先頭5件
-
Object
# class -> Class (21263.0) -
レシーバのクラスを返します。
...レシーバのクラスを返します。
//emlist[][ruby]{
p "ruby".class #=> String
p 100.class #=> Integer
p ARGV.class #=> Array
p self.class #=> Object
p Class.class #=> Class
p Kernel.class #=> Module
//}
@see Class#superclass,Object#kind_of?,Object#instance_of?... -
Array
# to _ a -> Array (15282.0) -
self を返します。ただし、Array のサブクラスのインスタンスに対して呼ばれた時は、 自身を Array に変換したものを返します。
...、Array のサブクラスのインスタンスに対して呼ばれた時は、
自身を Array に変換したものを返します。
//emlist[例][ruby]{
class SubArray < Array; end
ary1 = Array([1, 2, 3, 4])
ary2 = SubArray([1, 2, 3, 4])
ary1.to_a # => [1, 2, 3, 4]
ary1.to_a.class #......=> Array
ary2.to_a # => [1, 2, 3, 4]
ary2.to_a.class # => Array
//}
@see Array#to_ary... -
Array
# to _ ary -> self (15143.0) -
self をそのまま返します。
...をそのまま返します。
//emlist[例][ruby]{
class SubArray < Array; end
ary1 = Array([1, 2, 3, 4])
ary2 = SubArray([1, 2, 3, 4])
ary1.to_ary # => [1, 2, 3, 4]
ary1.to_ary.class # => Array
ary2.to_ary # => [1, 2, 3, 4]
ary2.to_ary.class # => SubArray
//}
@see Array#to_a... -
Kernel
# DelegateClass(superclass) -> object (12319.0) -
クラス superclass のインスタンスへメソッドを委譲するクラスを定義し、 そのクラスを返します。
...superclass のインスタンスへメソッドを委譲するクラスを定義し、
そのクラスを返します。
@param superclass 委譲先となるクラス
例:
//emlist{
require 'delegate'
class ExtArray < DelegateClass(Array)
def initialize
super([])
end
end
a = ExtArray.new......p a.class # => ExtArray
a.push 25
p a # => [25]
//}... -
Module
# public _ class _ method(*name) -> self (12233.0) -
name で指定したクラスメソッド (クラスの特異メソッド) の 可視性を public に変更します。
...String または Symbol を指定します。
@param names 0 個以上の String または Symbol を Array で指定します。
//emlist[例][ruby]{
class Foo
def self.foo
"foo"
end
private_class_method :foo
end
Foo.foo # NoMethodError: private method `foo' called for Foo:Class
Foo.......public_class_method(:foo) # => Foo
Foo.foo # => "foo"
//}... -
Module
# public _ class _ method(names) -> self (12233.0) -
name で指定したクラスメソッド (クラスの特異メソッド) の 可視性を public に変更します。
...String または Symbol を指定します。
@param names 0 個以上の String または Symbol を Array で指定します。
//emlist[例][ruby]{
class Foo
def self.foo
"foo"
end
private_class_method :foo
end
Foo.foo # NoMethodError: private method `foo' called for Foo:Class
Foo.......public_class_method(:foo) # => Foo
Foo.foo # => "foo"
//}... -
Module
# private _ class _ method(*name) -> self (12227.0) -
name で指定したクラスメソッド (クラスの特異メソッド) の 可視性を private に変更します。
...性を private に変更します。
@param name 0 個以上の String または Symbol を指定します。
@param names 0 個以上の String または Symbol を Array で指定します。
//emlist[例][ruby]{
module Foo
def self.foo; end
end
Foo.singleton_class.private_method_defined?(:f......oo) # => false
Foo.private_class_method(:foo) # => Foo
Foo.singleton_class.private_method_defined?(:foo) # => true
//}... -
Module
# private _ class _ method(names) -> self (12227.0) -
name で指定したクラスメソッド (クラスの特異メソッド) の 可視性を private に変更します。
...性を private に変更します。
@param name 0 個以上の String または Symbol を指定します。
@param names 0 個以上の String または Symbol を Array で指定します。
//emlist[例][ruby]{
module Foo
def self.foo; end
end
Foo.singleton_class.private_method_defined?(:f......oo) # => false
Foo.private_class_method(:foo) # => Foo
Foo.singleton_class.private_method_defined?(:foo) # => true
//}... -
TSort
# strongly _ connected _ components -> Array (9208.0) -
強連結成分の集まりを配列の配列として返します。 この配列は子から親に向かってソートされています。 各要素は強連結成分を表す配列です。
...t[使用例][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.......strongly_connected_components...