とんちゃんといっしょ

Cloudに関する技術とか日常とかについて書いたり書かなかったり

2013-02-12から1日間の記事一覧

Ruby 2.0の機能解説メモ(Itoplevel)

* toplevel * added method: * added main.define_method which defines a global function. * added main.using, which imports refinements into the current file or eval string. [experimental] 追加されたメソッド main.define_method グローバルな関…

Ruby 2.0の機能解説メモ(Mutex)

* Mutex * added method: * added Mutex#owned? which returns the mutex is held by current thread or not. [experimental] * incompatible changes: * Mutex#lock, Mutex#unlock, Mutex#try_lock, Mutex#synchronize and Mutex#sleep are no longer allow…

Ruby 2.0の機能解説メモ(NilClass)

* NilClass * added method: * added nil.to_h which returns {} 追加されたメソッド NilClass#to_h nilに対してto_hを呼ぶと空のハッシュが返ってくるようになった。 これにて、nil.to_aやnil.to_sと同じような動きになったらしい。 #いままでだとnil.to_h…

Ruby 2.0の機能解説メモ(LoadError)

* LoadError * added method: * added LoadError#path method to return the file name that could not be loaded. 追加されたメソッド LoadError#path ロードできなかったファイルの名前を返す。 何がどうなってるのかよくわからないが、pryで確認してもnil…

Ruby 2.0の機能解説メモ(IO)

* IO * deprecated methods: * IO#lines, #bytes, #chars and #codepoints are deprecated. 廃止予定のメソッド IO#lines IO#bytes IO#chars IO#codepoints