Skip to content

Commit

Permalink
Proc.new -> proc に変更
Browse files Browse the repository at this point in the history
  • Loading branch information
Kazuaki Harada authored and Kazuaki Harada committed Oct 9, 2012
1 parent 8282ac3 commit 3e19b91
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions example/sample1.rb
Expand Up @@ -73,16 +73,16 @@
# シングルクォーテーションでの囲みがかからなくなります
#
procs = {
:brand_id => Proc.new{|v|v[:brand_id]},
:shop_id => Proc.new{|v|v[:shop_id]},
:user_id => Proc.new{|v|v['user_id']},
:name => Proc.new{|v|"#{v[:brand_id]}_#{v[:shop_id]}_#{v['user_id']}'s name"},
:value1 => Proc.new{rand(10000)},
:value_nil => Proc.new{nil},
:value_func => Proc.new{"CONCAT('My', 'S', 'QL')".to_func}, #関数指定時はString#to_funcで
:value_true => Proc.new{true}, # true は 1 false は 0
:value_time => Proc.new{Time.mktime(2001,2,3,4,35,6)}, # Time,DateTime,Date
:created_at => Proc.new{'NOW()'.to_func},
:brand_id => proc{|v|v[:brand_id]},
:shop_id => proc{|v|v[:shop_id]},
:user_id => proc{|v|v['user_id']},
:name => proc{|v|"#{v[:brand_id]}_#{v[:shop_id]}_#{v['user_id']}'s name"},
:value1 => proc{rand(10000)},
:value_nil => proc{nil},
:value_func => proc{"CONCAT('My', 'S', 'QL')".to_func}, #関数指定時はString#to_funcで
:value_true => proc{true}, # true は 1 false は 0
:value_time => proc{Time.mktime(2001,2,3,4,35,6)}, # Time,DateTime,Date
:created_at => proc{'NOW()'.to_func},
}
#
# 実際にテストデータを作成します
Expand Down

0 comments on commit 3e19b91

Please sign in to comment.