るりまサーチ

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

別のキーワード

  1. _builtin %
  2. bigdecimal %
  3. range %
  4. bn %
  5. float %

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 > >>

Enumerator::Lazy#map {|item| ... } -> Enumerator::Lazy (15142.0)

Enumerable#map と同じですが、配列ではなくEnumerator::Lazy を返します。

...ble#map と同じですが、配列ではなくEnumerator::Lazy を返します。

@raise ArgumentError ブロックを指定しなかった場合に発生します。

//emlist[例][ruby]{
1.step.lazy.map{ |n| n % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:map>

1...
....step.lazy.collect{ |n| n.succ }.take(10).force
# => [2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
//}

@see Enumerable#map...

String#pathmap(spec = nil) { ... } -> String (6179.0)

与えられた書式指定文字列に応じてパス(自身)を変換します。

...す。

: %p
完全なパスを表します。
: %f
拡張子付きのファイル名を表します。ディレクトリ名は含まれません。
: %n
拡張子なしのファイル名を表します。
: %d
パスに含まれるディレクトリのリストを表します。
: %x
...
...す。
: %X
拡張子以外すべてを表します。
: %s
定義されていれば、代替のファイルセパレータを表します。
定義されてい無い場合は、標準のファイルセパレータを表します。
: %%
パーセント自身を表します。


%
d は数値...
...のプレフィクスを取ることができます。

例:
'a/b/c/d/file.txt'.pathmap("%2d") # => 'a/b'
'a/b/c/d/file.txt'.pathmap("%-2d") # => 'c/d'

また、%d, %p, %f, %n, %x, %X には単純な文字列置換を行うための
置換パターンを表すパラメータを指定する...

Exception2MessageMapper#Fail(exception_class = nil, *rest) -> () (3013.0)

登録されている情報を使用して、例外を発生させます。

...aise Exception2MessageMapper::ErrNotRegisteredException 指定された例外クラスに対応するメッセージが存在しない場合に発生します。

例:

class Foo
extend Exception2MessageMapper
p def_exception :NewExceptionClass, "message...%d, %d and %d" # =>

def...

Exception2MessageMapper#Raise(exception_class = nil, *rest) -> () (3013.0)

登録されている情報を使用して、例外を発生させます。

...aise Exception2MessageMapper::ErrNotRegisteredException 指定された例外クラスに対応するメッセージが存在しない場合に発生します。

例:

class Foo
extend Exception2MessageMapper
p def_exception :NewExceptionClass, "message...%d, %d and %d" # =>

def...

TSort#each_strongly_connected_component_from(node, id_map={}, stack=[]) -> Enumerator (109.0)

node から到達可能な強連結成分についてのイテレータです。

...h_strongly_connected_component{|nodes|
p nodes
nodes.each {|node|
non_sort.each_strongly_connected_component_from(node){|ns|
printf("%s -> %s\n", node, ns.join(","))
}
}
}

#出力
#=> [4]
#=> 4 -> 4
#=> [2, 3]
#=> 2 -> 4
#=> 2 -> 2,3
#=> 3 -> 4
#=> 3 -> 3,2
#=> [1]
#=> 1 -> 4
#=...

絞り込み条件を変える

TSort#each_strongly_connected_component_from(node, id_map={}, stack=[]) {|nodes| ...} -> () (109.0)

node から到達可能な強連結成分についてのイテレータです。

...h_strongly_connected_component{|nodes|
p nodes
nodes.each {|node|
non_sort.each_strongly_connected_component_from(node){|ns|
printf("%s -> %s\n", node, ns.join(","))
}
}
}

#出力
#=> [4]
#=> 4 -> 4
#=> [2, 3]
#=> 2 -> 4
#=> 2 -> 2,3
#=> 3 -> 4
#=> 3 -> 3,2
#=> [1]
#=> 1 -> 4
#=...

Enumerator::Lazy#collect {|item| ... } -> Enumerator::Lazy (42.0)

Enumerable#map と同じですが、配列ではなくEnumerator::Lazy を返します。

...ble#map と同じですが、配列ではなくEnumerator::Lazy を返します。

@raise ArgumentError ブロックを指定しなかった場合に発生します。

//emlist[例][ruby]{
1.step.lazy.map{ |n| n % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:map>

1...
....step.lazy.collect{ |n| n.succ }.take(10).force
# => [2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
//}

@see Enumerable#map...

Object#enum_for(method = :each, *args) -> Enumerator (19.0)

Enumerator.new(self, method, *args) を返します。

...@param args 呼び出すメソッドに渡される引数です。

//emlist[][ruby]{
str = "xyz"

enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]

# protects an array from being modified
a = [1, 2, 3]
p(a.to_enum) #=> #<Enumerator: [1, 2, 3]:each>
//}

//emli...
...ば size * n を返す。
sz = size
sz * n if sz
end
end
each do |*val|
n.times { yield *val }
end
end
end

%
i[hello world].repeat(2) { |w| puts w }
# => 'hello', 'hello', 'world', 'world'
enum = (1..14).repeat(3)
# => #<Enumerator: 1..14:repeat(3)>
enum.fir...

Object#enum_for(method = :each, *args) {|*args| ... } -> Enumerator (19.0)

Enumerator.new(self, method, *args) を返します。

...@param args 呼び出すメソッドに渡される引数です。

//emlist[][ruby]{
str = "xyz"

enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]

# protects an array from being modified
a = [1, 2, 3]
p(a.to_enum) #=> #<Enumerator: [1, 2, 3]:each>
//}

//emli...
...ば size * n を返す。
sz = size
sz * n if sz
end
end
each do |*val|
n.times { yield *val }
end
end
end

%
i[hello world].repeat(2) { |w| puts w }
# => 'hello', 'hello', 'world', 'world'
enum = (1..14).repeat(3)
# => #<Enumerator: 1..14:repeat(3)>
enum.fir...

Object#to_enum(method = :each, *args) -> Enumerator (19.0)

Enumerator.new(self, method, *args) を返します。

...@param args 呼び出すメソッドに渡される引数です。

//emlist[][ruby]{
str = "xyz"

enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]

# protects an array from being modified
a = [1, 2, 3]
p(a.to_enum) #=> #<Enumerator: [1, 2, 3]:each>
//}

//emli...
...ば size * n を返す。
sz = size
sz * n if sz
end
end
each do |*val|
n.times { yield *val }
end
end
end

%
i[hello world].repeat(2) { |w| puts w }
# => 'hello', 'hello', 'world', 'world'
enum = (1..14).repeat(3)
# => #<Enumerator: 1..14:repeat(3)>
enum.fir...

絞り込み条件を変える

<< 1 2 > >>