キモブロ

Please spy check please, Fucking retard

Hashie::Clashについて

Chainable Lazy Hashを生成してくれるのか。何これカワイイ

require 'hashie'

c = Hashie::Clash.new
c.where(:abc => 'def')
p c
# => {:where=>{:abc=>"def"}}

c = Hashie::Clash.new
c.where(:abc => 'def').where(:hoge => 'fuga')
p c
# => {:where=>{:abc=>"def", :hoge=>"fuga"}}

c = Hashie::Clash.new
c.aiueo(:key => :value).kakikukeko(:key2 => :value2)
p c
# => {:aiueo=>{:key=>:value}, :kakikukeko=>{:key2=>:value2}}

ActiveRecordのarelとかDataMapperの内部実装で使ってそうなモジュールだ