[#42945] [Ruby 1.8-Bug#4231][Open] configure.bat --with-winsock2 が socket/extconf.rbに効いていない — Masahiro Kitajima <redmine@...>

Bug #4231: configure.bat --with-winsock2 が socket/extconf.rbに効いていない

8 messages 2011/01/05

[#43027] [Ruby 1.9-Feature#4280][Assigned] SJIS should be an alias of Windows-31J, not of Shift_JIS — Usaku NAKAMURA <redmine@...>

Feature #4280: SJIS should be an alias of Windows-31J, not of Shift_JIS

13 messages 2011/01/14
[#43030] [Ruby 1.9-Feature#4280] SJIS should be an alias of Windows-31J, not of Shift_JIS — Motohiro KOSAKI <redmine@...> 2011/01/14

チケット #4280 が更新されました。 (by Motohiro KOSAKI)

[#43031] Re: [Ruby 1.9-Feature#4280] SJIS should be an alias of Windows-31J, not of Shift_JIS — "U.Nakamura" <usa@...> 2011/01/14

こんにちは、なかむら(う)です。

[#43033] Re: [Ruby 1.9-Feature#4280] SJIS should be an alias of Windows-31J, not of Shift_JIS — KOSAKI Motohiro <kosaki.motohiro@...> 2011/01/14

2011年1月14日16:35 U.Nakamura <usa@garbagecollect.jp>:

[#43039] ext/openssl development repository — Hiroshi Nakamura <nakahiro@...>

W3J1YnktY29yZTozNDQxNl3jga7ml6XmnKzlkJHjgZHniYjjgafjgZnjgIIKCuacgOi/kU1hcnRp

21 messages 2011/01/14
[#43040] Re: ext/openssl development repository — "U.Nakamura" <usa@...> 2011/01/14

こんにちは、なかむら(う)です。

[#43041] Re: ext/openssl development repository — Yusuke ENDOH <mame@...> 2011/01/14

遠藤です。

[#43053] Re: ext/openssl development repository — Hiroshi Nakamura <nakahiro@...> 2011/01/17

MjAxMS8xLzE0IFl1c3VrZSBFTkRPSCA8bWFtZUB0c2cubmUuanA+Ogo+Pj4gwqAgwqAgwqAgwqAg

[#43092] pthread_cond を用いたConditionVariable — keiju@... (Keiju ISHITSUKA)

けいじゅ@いしつかです.

15 messages 2011/01/24

[ruby-dev:42972] Re: 特異メソッドの定義の簡略化

From: Kenta Murata <muraken@...>
Date: 2011-01-07 01:11:03 UTC
List: ruby-dev #42972
むらたです。

2011年1月7日9:18  <hattorihiroaki1@mail.goo.ne.jp>:
>> OpenStruct にお望みの挙動が実装されています。
>
> ありがとうございます。うれしいのですが、OpenStructという名前が長いので使うのに躊躇しそうです。

たとえば

  require 'ostruct'
  OS = OpenStruct
  s = OS.new(a: [1, 2, 3], foo: 5)
  s.a #=> [1, 2, 3]
  s.foo #=> 5

このように、適当に短い名前を自分で作ってしまえば長くないですよね。

> 具体的にはHashでもいいかなと…(せっかく教えていただいたのにすみません)
>
> s = {a: [1,2,3], foo: 5}
> s[:a]
> s[:foo]
>
> ## method missing をつかって s.a, s,fooと書けたら最高。Matzさんどうですか?

こちらに関しては

  require 'ostruct'
  class Hash
    def to_os
      OpenStruct.new(self)
    end
  end

こうしておけば

  s = {a: [1, 2, 3], foo: 5}.to_os
  s.a #=> [1, 2, 3]
  s.foo #=> 5

とできますね。

-- 
Kenta Murata
OpenPGP FP = 1D69 ADDE 081C 9CC2 2E54  98C1 CEFE 8AFB 6081 B062

本を書きました!!
『Ruby 逆引きレシピ』 http://www.amazon.co.jp/dp/4798119881/mrkn-22

E-mail: mrkn@mrkn.jp
twitter: http://twitter.com/mrkn/
blog: http://d.hatena.ne.jp/mrkn/

In This Thread