mustmodify / valuable

quick ruby modeling -- basically attr_accessor with default values, light-weight casting, and a constructor
http://valuable.mustmodify.com/
MIT License
72 stars 3 forks source link

Can't pass a logger as a default value for an attribute #19

Open mustmodify opened 9 years ago

mustmodify commented 9 years ago

class Retryer has_value :logger, :default => Rails.logger end

results in: TypeError: can't dump File

stack trace:

   # ../gems/ruby-1.9.3-p448/gems/rspec-mocks-2.13.1/lib/rspec/mocks/extensions/marshal.rb:5:in `dump'
   # ../gems/ruby-1.9.3-p448/gems/rspec-mocks-2.13.1/lib/rspec/mocks/extensions/marshal.rb:5:in `dump_with_mocks'
   # ../gems/ruby-1.9.3-p448/gems/valuable-0.9.9/lib/valuable/utils.rb:33:in `deep_duplicate_of'
   # ../gems/ruby-1.9.3-p448/gems/valuable-0.9.9/lib/valuable/utils.rb:25:in `block in initial_copy_of_attributes'
   # ../gems/ruby-1.9.3-p448/gems/valuable-0.9.9/lib/valuable/utils.rb:20:in `each'
   # ../gems/ruby-1.9.3-p448/gems/valuable-0.9.9/lib/valuable/utils.rb:20:in `initial_copy_of_attributes'