るりまサーチ

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

別のキーワード

  1. _builtin hash
  2. hash []
  3. matrix hash
  4. dbm to_hash
  5. _builtin to_hash

検索結果

<< 1 2 > >>

Hash#default_proc -> Proc | nil (21036.0)

ハッシュのデフォルト値を返す Proc オブジェクトを返します。 ハッシュがブロック形式のデフォルト値を持たない場合 nil を返します。

...を返します。

//emlist[例][ruby]{
h = Hash.new {|hash, key| "The #{key} not exist in #{hash.inspect}"}
p h.default #=> nil
p block = h.default_proc #=> #<Proc:0x0x401a9ff4>
p block.call({},:foo) #=> "The foo not exist in {}"

h = Hash.new("default")
p h.default #=...
...> "default"
p h.default_proc #=> nil
//}

@see Hash#default...

メソッド呼び出し(super・ブロック付き・yield) (3076.0)

メソッド呼び出し(super・ブロック付き・yield) * super * block * yield * block_arg * numbered_parameters * call_method

...メソッド呼び出し(super・ブロック付き・yield)
* super
* block
* yield
* block_arg
* numbered_parameters
* call_method

//emlist[例][ruby]{
foo.bar()
foo.bar
bar()
print "hello world\n"
print
Class.new
Class::new
//}

文法:

[式 `.'] 識別子 [`(' [[`*']...
...シュ式の解説(d:spec/literal#hash)にも書かれている通り、
メソッド呼出の末尾にHashを渡す場合は {, } を省略することができます。
これを用いることでキーワード引数を渡すことができます。
この Hash はd:spec/def#methodで解説され...
...p b # => "b"
}
//}

===[a:call_method] .() および ::() 形式のメソッド呼び出し(callメソッドの糖衣構文)

下記はcallメソッドの糖衣構文です。
Proc#callにも言及がありますが、Proc以外のオブジェクトに対しても(callメソッドさえ定義...

1.6.8から1.8.0への変更点(まとめ) (186.0)

1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))

...クがゆるい。break が例外になる。

Proc.new {|a,b,c| p [a,b,c]}.call(1,2)
=> -:1: wrong # of arguments (2 for 3) (ArgumentError)
from -:1:in `call'
from -:1
ruby 1.6.8 (2002-12-24) [i586-linux]...
...=> ruby 1.8.0 (2003-06-21) [i586-linux]
[1, 2, nil]

Proc.new { break }.call

=> ruby 1.6.8 (2002-12-24) [i586-linux]

=> -:1:in `call': break from proc-closure (LocalJumpError)
from -:1
ruby 1....
...((<ENV/ENV.clear>)) [new]
: ((<ENV/ENV.shift>)) [new]
: ((<ENV/ENV.invert>)) [new]
: ((<ENV/ENV.replace>)) [new]
: ((<ENV/ENV.update>)) [new]

((<Hash>)) との互換性のために定義されました。

=== Enumerable

: ((<Enumerable#partition|Enumerable/partition>)) [new]

追加

: ((<Enu...

ruby 1.9 feature (126.0)

ruby 1.9 feature ruby version 1.9.0 は開発版です。 以下にあげる機能は将来削除されたり互換性のない仕様変更がなされるかもしれません。 1.9.1 以降は安定版です。 バグ修正がメインになります。

...: digest.rb
: Digest::Base.file

=== 2006-09-13

: Hash#compare_by_identity
: Hash#compare_by_identity?
: Hash#identical
: Hash#identical?

=== 2006-09-12

: Hash#compare_by_identity
: Hash#compare_by_identity?

=== 2006-09-11

: Hash#identical
: Hash#identical?

=== 2006-08-31

: Array#shuffle
: Ar...
...lk:197512>))

=== 2006-06-13

: IPsocket
: TCPsocket
: SOCKSsocket
: TCPserver
: UDPsocket
: UNIXsocket
: UNIXserver

削除

=== 2006-06-11

: __callee__ [new]
: __method__ [new]

((<URL:http://www.dm4lab.to/~usa/ruby/d/200606a.html#id20060610_P1_7>))

: Symbol#to_proc

=== 2006-06-10

* 新機...
...: いくらか obsolete な構文が除去されました
: Values はなくなりました

* その他
: 文字列のハッシュに FNV-1a hash を使用するようになりました
: Regexp#initialize でリテラルの正規表現を変更できなくなりました
: $SAFE=4 で...

NEWS for Ruby 3.0.0 (114.0)

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

...ocs
accepting a single rest argument and no keywords.
16166

//emlist[][ruby]{
pr = proc{|*a, **kw| [a, kw]}

pr.call([1])
# 2.7 => [[1], {}]
# 3.0 => [[[1]], {}]

pr.call([1, {a: 1}])
# 2.7 => [[1], {:a=>1}] # and deprecation warning
# 3.0 => a=>1}, {}]
//}

* Arguments forwarding (`...`)...
...== Core classes updates

Outstanding ones only.

* Array
* The following methods now return Array instances instead of subclass instances when called on subclass instances: 6087
* Array#drop
* Array#drop_while
* Array#flatten
* Array#slice!
* Array#slice / Array#[...
...ob and Dir.[] now sort the results by default, and accept the `sort:` keyword option. 8709
* ENV
* ENV.except has been added, which returns a hash excluding the given keys and their values. 15822
* Windows: Read ENV names and values as UTF-8 encoded Strings 12650
* Encoding
* Added...

絞り込み条件を変える

Gem::Requirement::OPS -> Hash (113.0)

比較演算子と対応する処理を格納したハッシュです。次の内容と等価です。

...mp },
}.freeze
//}

次のように、Gem::Version どうしを比較します。

//emlist[][ruby]{
p Gem::Requirement::OPS["="].call(Gem::Version.new('3.1'), Gem::Version.new('3.0')) # => false
p Gem::Requirement::OPS["~>"].call(Gem::Version.new('3.1'), Gem::Version.new('3.0')) # => true
//}...

ruby 1.6 feature (108.0)

ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。

...うです。
((<ruby-win32:273>))

: 2002-08-12 Hash#==

Hash
オブジェクトはデフォルト値 (((<Hash/default>))) も == で等しい
ときに等しいとみなされるようになりました。

p Hash.new("foo") == Hash.new("bar")

=> ruby 1.6.7 (2002-03-01) [i586...
...[]
=> ruby 1.6.7 (2002-08-01) [i586-linux]
["bar"]

: 2002-06-13 Hash[]

Hash
[] で、キーとなる文字列を dup & freeze していませんでした。

a = "key"
h = Hash[a,"val"]
h.keys[0].upcase!
p a
=> ruby 1.6.7 (2002-03-01) [...
...-:9: warning: p (...) interpreted as method call
ruby 1.6.5 (2001-09-19) [i586-linux]
Bar
[1, 2, 3]
Bar
Array
Array
Array
=> -:9: warning: p (...) interpreted as method call
ruby 1.6.5 (2001-10-05) [i586-...

NEWS for Ruby 2.6.0 (90.0)

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

...と :order を受け付けるようになりました。 14324

* Hash
* 変更されたメソッド
* Hash#merge, Hash#merge!, Hash#update が引数を複数受け付けるようになりました。 15111
* Hash#to_h はブロックを受け取りキーと値のペアを新し...
...いキーと値に変換できるようになりました。 15143
* 別名
* Hash#filter が Hash#select の別名として追加されました。 13784
* Hash#filter! が Hash#select! の別名として追加されました。 13784

* IO
* 新規オプション
* 排...
...Proc
* 新規メソッド
* 関数合成用に Proc#<< と Proc#>> が追加されました。 6284
* 非互換な変更
* Proc#call が $SAFE を変更しなくなりました。 14250

* Random
* 新規メソッド
* Random.bytes が追加されました。 4938...

NEWS for Ruby 2.2.0 (84.0)

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

...ださい。

== 2.1.0 以降の変更

=== 言語仕様の変更

* nil/true/false
* nil/true/false はフリーズされました 8923

* Hash リテラル
* 後ろにコロンのあるシンボルをキーにしたときそれをクオートできるようになりました 4276

*...
...Ua4uBr6o0k-nORrZLEIIUkHJ9JRzRR0NyZfrhEEnc8/edit?usp=sharing

* Hash
* 非互換: 重複するキーの上書きに関するポリシーを変更しました 10315
{ **hash1, **hash2 } は重複するキーについては hash2 の値を持ちます

* IO
* 非互換: IO#flush を...
...2以前は読み込みモードで開いていました。

=== 標準添付ライブラリの更新 (優れたもののみ)

* continuation
* callcc は廃止されました。Fiberを使ってください。

* digest
* Kernel.#Digest はスレッドセーフになりました。...

ruby 1.8.4 feature (84.0)

ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。

...re/set_trace_func [bug]>))
* ((<ruby 1.8.4 feature/set_trace_func [change]>))
* ((<ruby 1.8.4 feature/printf [bug]>))
* ((<ruby 1.8.4 feature/Hash [bug]>))
* ((<ruby 1.8.4 feature/test [bug]>))
* ((<ruby 1.8.4 feature/File.identical? [new]>))
* ((<ruby 1.8.4 feature/FileTest.identical? [...
...)
* ((<ruby 1.8.4 feature/mkmf: find_executable() [compat]>))
* ((<ruby 1.8.4 feature/拡張ライブラリAPI>))
* ((<ruby 1.8.4 feature/rb_funcall2() [bug]>))
* ((<ruby 1.8.4 feature/rb_respond_to() [change]>))
* ((<ruby 1.8.4 feature/rb_obj_respond_to() [new]>))
* ((<ruby 1.8.4 feature/...
...cted '(', expecting $end

#Tue Nov 1 14:20:11 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
#
# * eval.c (rb_call_super): should call method_missing if super is
# called from Kernel method.
#
# * eval.c (exec_under): frame during eval should preserve external
# informat...

絞り込み条件を変える

NEWS for Ruby 2.3.0 (78.0)

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

...に対応する File::TMPFILE(File::Constants::TMPFILE) を追加

* Hash
* Hash#fetch_values を追加
10017
* Hash#dig を追加
11643
* Hash#<=, Hash#<, Hash#>=, Hash#> を追加
10984
* Hash#to_proc を追加
11653

* IO
* 新しいフラグ File::...
...umeric#negative? を追加
11151

* Proc
* Proc#call ( Proc#[] , Proc#===, Proc#yield) は最適化されました。
Backtrace doesn't show each method (show block lines directly).
TracePoint also ignores these calls.
11569

* Queue (Thread::Queue)
* 終了を通...
...に 0 を返していましたが、
BY_HANDLE_FILE_INFORMATION.nFileIndexHigh/Low を返すようになりました。
11216

* Hash
* Hash#inspect はその要素の文字列が Encoding.default_external と
互換性のないエンコーディングであっても例外が...
<< 1 2 > >>