るりまサーチ

最速Rubyリファレンスマニュアル検索!
5149件ヒット [5101-5149件を表示] (0.097秒)
トップページ > クエリ:i[x] > クエリ:key[x]

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. csv to_i
  5. matrix i

ライブラリ

オブジェクト

キーワード

検索結果

<< < ... 50 51 52 >>

Hash#reject -> Enumerator (25.0)

self を複製して、ブロックを評価した値が真になる要 素を削除したハッシュを返します。

...す。
selfを破壊的に変更したい場合はかわりにHash#delete_ifかHash#reject!を使います。

//emlist[例][ruby]{
h = { 2 =>"8" ,4 =>"6" ,6 =>"4" ,8 =>"2" }

p h.reject{|key, value| key.to_i < value.to_i} #=> {6=>"4", 8=>"2"}
//}

@see Hash#delete_if,Hash#delete,Enumerable#reject...

Enumerable#to_h(*args) -> Hash (22.0)

self を [key, value] のペアの配列として解析した結果を Hash にして 返します。

...self を [key, value] のペアの配列として解析した結果を Hash にして
返します。

@param args each の呼び出し時に引数として渡されます。

//emlist[例][ruby]{
%i[hello world].each_with_index.to_h # => {:hello => 0, :world => 1}
//}...
...self を [key, value] のペアの配列として解析した結果を Hash にして
返します。

@param args each の呼び出し時に引数として渡されます。

//emlist[例][ruby]{
%i[hello world].each_with_index.to_h # => {:hello => 0, :world => 1}
//}

ブロックを指定する...
...と各要素でブロックを呼び出し、
その結果をペアとして使います。

//emlist[ブロック付きの例][ruby]{
(1..5).to_h {|x| [x, x ** 2]} # => {1=>1, 2=>4, 3=>9, 4=>16, 5=>25}
//}...

Enumerable#to_h(*args) { ... } -> Hash (22.0)

self を [key, value] のペアの配列として解析した結果を Hash にして 返します。

...self を [key, value] のペアの配列として解析した結果を Hash にして
返します。

@param args each の呼び出し時に引数として渡されます。

//emlist[例][ruby]{
%i[hello world].each_with_index.to_h # => {:hello => 0, :world => 1}
//}

ブロックを指定する...
...と各要素でブロックを呼び出し、
その結果をペアとして使います。

//emlist[ブロック付きの例][ruby]{
(1..5).to_h {|x| [x, x ** 2]} # => {1=>1, 2=>4, 3=>9, 4=>16, 5=>25}
//}...

NEWS for Ruby 2.0.0 (18.0)

NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...ての変更のリストは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。

== 1.9.3 以降の変更

=== 言語仕様の変更

* キーワード引数を追加しました
* %i, %I をシンボルの配列作成のために追加しました。(%w, %W に...
...コーディングを US-ASCII から UTF-8 に変更しました
* '_' で始まる使用されていない変数は警告しなくなりました

=== 組み込みクラスの更新

* ARGF.class
* 追加: ARGF.class#codepoints, ARGF.class#each_codepoint
I
O にある同名のメソ...
...SL requires passwords for decrypting PEM-encoded files to be at least
four characters long. This led to awkward situations where an export with
a password with fewer than four characters was possible, but accessing the
file afterwards failed. OpenSSL::PKey::RSA, OpenSSL::PKey::DSA...

tsort (18.0)

tsort はトポロジカルソートと強連結成分に関するモジュールを提供します。

...ソートと強連結成分に関するモジュールを提供します。

=== Example

//emlist[][ruby]{
require 'tsort'

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

{1=>[2, 3], 2=>[3], 3=>[], 4=>[]}.tsor...
...きます。

//emlist[][ruby]{
require 'tsort'

class Make
def initialize
@dep = {}
@dep.default = []
end

def rule(outputs, inputs=[], &block)
triple = [outputs, inputs, block]
outputs.each {|f| @dep[f] = [triple]}
@dep[triple] = inputs
end

def build(target)
each...
...ns|
i
f ns.length != 1
fs = ns.delete_if {|n| Array === n}
raise TSort::Cyclic.new("cyclic dependencies: #{fs.join ', '}")
end
n = ns.first
i
f Array === n
outputs, inputs, block = n
i
nputs_time = inputs.map {|f| File.mtime f}.max
begin...

絞り込み条件を変える

<< < ... 50 51 52 >>