るりまサーチ

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

別のキーワード

  1. openssl p
  2. openssl p=
  3. fileutils mkdir_p
  4. rsa p
  5. dsa p

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

StopIteration#result -> object (21126.0)

この例外オブジェクトを発生させる原因となったメソッド等の返り値を返します。

...ect = Object.new
def object.each
yield :yield1
yield :yield2
:each_returned
end

enumerator = object.to_enum

p
enumerator.next #=> :yield1
p
enumerator.next #=> :yield2

begin
enumerator.next
rescue StopIteration => error
p
error.result #=> :each_returned
end...

ERB#result(b=TOPLEVEL_BINDING) -> String (18214.0)

ERB を b の binding で実行し、結果の文字列を返します。

...を b の binding で実行し、結果の文字列を返します。

@param b eRubyスクリプトが実行されるときのbinding

//emlist[例][ruby]{
require 'erb'
erb = ERB.new("test <%= test1 %>\ntest <%= test2 %>\n")
test1 = "foo"
test2 = "bar"
p
uts erb.result
# test foo
# test bar
//}...
...し、結果の文字列を返します。

@param b eRubyスクリプトが実行されるときのbinding

//emlist[例][ruby]{
require 'erb'
erb = ERB.new("test <%= test1 %>\ntest <%= test2 %>\n")
test1 = "foo"
test2 = "bar"
p
uts erb.result
# test foo
# test bar
//}

@see ERB#result_with_hash...

Array#repeated_permutation(n) -> Enumerator (12220.0)

サイズ n の重複順列をすべて生成し,それを引数としてブロックを実行します。

...オブジェクトを返します。

@param n 生成する配列のサイズを整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
黙の型変換を試みます。

@raise TypeError 引数に整数以外の(暗黙...
...a.repeated_permutation(1).to_a #=> [[1], [2]]
a.repeated_permutation(2).to_a #=> [[1,1],[1,2],[2,1],[2,2]]
a.repeated_permutation(3).to_a #=> [[1,1,1],[1,1,2],[1,2,1],[1,2,2],
# [2,1,1],[2,1,2],[2,2,1],[2,2,2]]
a.repeated_permutation(0).to_a #=> [[]] # one perm...
...ロックを実
行して self を返します。

//emlist[例][ruby]{
a = [1, 2]
result
= []
a.repeated_permutation(3) {|e| result << e} # => [1,2]
result
#=> [[1,1,1],[1,1,2],[1,2,1],[1,2,2],
# [2,1,1],[2,1,2],[2,2,1],[2,2,2]]
//}

@see Array#repeated_combination, Array#permutation...

Array#repeated_permutation(n) { |p| ... } -> self (12220.0)

サイズ n の重複順列をすべて生成し,それを引数としてブロックを実行します。

...オブジェクトを返します。

@param n 生成する配列のサイズを整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
黙の型変換を試みます。

@raise TypeError 引数に整数以外の(暗黙...
...a.repeated_permutation(1).to_a #=> [[1], [2]]
a.repeated_permutation(2).to_a #=> [[1,1],[1,2],[2,1],[2,2]]
a.repeated_permutation(3).to_a #=> [[1,1,1],[1,1,2],[1,2,1],[1,2,2],
# [2,1,1],[2,1,2],[2,2,1],[2,2,2]]
a.repeated_permutation(0).to_a #=> [[]] # one perm...
...ロックを実
行して self を返します。

//emlist[例][ruby]{
a = [1, 2]
result
= []
a.repeated_permutation(3) {|e| result << e} # => [1,2]
result
#=> [[1,1,1],[1,1,2],[1,2,1],[1,2,2],
# [2,1,1],[2,1,2],[2,2,1],[2,2,2]]
//}

@see Array#repeated_combination, Array#permutation...

Gem::DependencyList#spec_predecessors -> Hash (9107.0)

@todo ???

...@todo ???

Return a hash of predecessors. <tt>result[spec]</tt> is an
Array of gemspecs that have a dependency satisfied by the named
spec....

絞り込み条件を変える

OpenSSL::SSL::SSLSocket#verify_result -> Integer (9102.0)

検証結果のエラーコードを整数値で返します。

...検証結果のエラーコードを整数値で返します。

エラーコードの整数値は OpenSSL::X509 に定数が定義されています。
詳しくは c:OpenSSL::X509#verify_error を見てください。
検証に成功した場合は OpenSSL::X509::V_OK を返します。...

Encoding::Converter#primitive_errinfo -> Array (6161.0)

直前の Encoding::Converter#primitive_convert による変換の結果を保持する五要素の配列を返します。

...直前の Encoding::Converter#primitive_convert による変換の結果を保持する五要素の配列を返します。

@return [result, enc1, enc2, error_bytes, readagain_bytes] という五要素の配列

result
は直前の primitive_convert の戻り値です。
それ以外の四要素は...
...:invalid_byte_sequence か :incomplete_input か :undefined_conversion だった場合に意味を持ちます。
enc1 はエラーの発生した原始変換の変換元のエンコーディング、enc2 は変換先のエンコーディングです。
error_bytes はエラーの発生原因とな...
...

p
rimitive_errinfo はもっぱら Encoding::Converter#primitive_convert と組み合わせて使います。Encoding::Converter#convert を用いている場合にも取得することはできますが、有用な使い方は難しいでしょう。

//emlist[][ruby]{
# \xff is invalid as EUC-JP....

Object#_dump(limit) -> String (6137.0)

Marshal.#dump において出力するオブジェクトがメソッド _dump を定義している場合には、そのメソッドの結果が書き出されます。

...Marshal.#dump において出力するオブジェクトがメソッド _dump
を定義している場合には、そのメソッドの結果が書き出されます。

バージョン1.8.0以降ではObject#marshal_dump, Object#marshal_loadの使用
が推奨されます。 Marshal.dump するオ...
...mp と marshal_dump の両方の
メソッドを持つ場合は marshal_dump が優先されます。

メソッド _dump は引数として再帰を制限するレベル limit を受
け取り、オブジェクトを文字列化したものを返します。

インスタンスがメソッド _dump...
...あります。

@param limit 再帰の制限レベルを表す整数です。
@return オブジェクトを文字列化したものを返すように定義すべきです。

//emlist[][ruby]{
class Foo
def initialize(arg)
@foo = arg
end
def _dump(limit)
Marshal.dump(@foo, limit)
en...

Object#marshal_dump -> object (6137.0)

Marshal.#dump を制御するメソッドです。

...Marshal.#dump を制御するメソッドです。

Marshal.dump(some) において、出力するオブジェクト some がメソッド marshal_dump
持つ場合には、その返り値がダンプされたものが Marshal.dump(some) の返り値となります。

marshal_dump/marshal_load...
...dump/_load ではなく
marshal_dump/marshal_load を使うべきです。

@return 任意のオブジェクトで marshal_load の引数に利用できます。

//emlist[][ruby]{
class Foo
def initialize(arg)
@foo = arg
end
def marshal_dump
@foo
end
def marshal_load(obj)
p
ob...
...end
foo = Foo.new(['foo', 'bar'])
p
foo #=> #<Foo:0xbaf3b0 @foo=["foo", "bar"]>
dms = Marshal.dump(foo)
p
dms #=> "\004\bU:\bFoo[\a\"\bfoo\"\bbar"
result
= Marshal.load(dms) #=> ["foo", "bar"] # marshal_load の引数
p
result #=> #<Foo:0xb...

Array#permutation(n = self.length) -> Enumerator (6120.0)

サイズ n の順列をすべて生成し,それを引数としてブロックを実行します。

...オブジェクトを返します。

@param n 生成する配列のサイズを整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
黙の型変換を試みます。

@raise TypeError 引数に整数以外の(暗黙...
...a.permutation.to_a #=> [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]
a.permutation(1).to_a #=> [[1],[2],[3]]
a.permutation(2).to_a #=> [[1,2],[1,3],[2,1],[2,3],[3,1],[3,2]]
a.permutation(3).to_a #=> [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]
a.permutation(0).to_a #=> [[]]: one per...
...ength 0
a.permutation(4).to_a #=> [] : no permutations of length 4
//}

ブロックが与えられた場合、作成した配列の各要素を引数としてブロックを実
行して self を返します。

//emlist[例][ruby]{
a = [1, 2, 3]
result
= []
a.permutation(2) {|e| result << e} # =...

絞り込み条件を変える

<< 1 2 3 ... > >>