<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -43,6 +43,13 @@ module Populator
       end
     end
     
+    def attributes=(values_hash)
+      values_hash.each_pair do |key, value|
+        value = value.call if value.is_a?(Proc)
+        self.send((key.to_s + &quot;=&quot;).to_sym, value)
+      end
+    end
+    
     private
     
     def method_missing(sym, *args, &amp;block)</diff>
      <filename>lib/populator/record.rb</filename>
    </modified>
    <modified>
      <diff>@@ -58,4 +58,17 @@ describe Populator::Record do
     Product.stubs(:column_names).returns(['id', 'foo'])
     Populator::Record.new(Product, 1).foo.should == 'Product'
   end
+  
+  it &quot;should allow set via attributes hash&quot; do
+    record = Populator::Record.new(Product, 1)
+    record.attributes = {:stock =&gt; 2..5}
+    record.stock.should &gt;= 2
+    record.stock.should &lt;= 5
+  end
+  
+  it &quot;should take a proc object via attributes hash&quot; do
+    record = Populator::Record.new(Product, 1)
+    record.attributes = {:stock =&gt; lambda {15}}
+    record.stock.should == 15
+  end
 end</diff>
      <filename>spec/populator/record_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>2ad402750b3978dbcb93db2ce889b6918c21222e</id>
    </parent>
  </parents>
  <author>
    <name>Brian Cooke</name>
    <email>bcooke@roobasoft.com</email>
  </author>
  <url>http://github.com/ryanb/populator/commit/5f85a6fa03ff4f22354c07e17e5e6c2c513da1a8</url>
  <id>5f85a6fa03ff4f22354c07e17e5e6c2c513da1a8</id>
  <committed-date>2008-09-26T19:59:18-07:00</committed-date>
  <authored-date>2008-09-26T19:59:18-07:00</authored-date>
  <message>Add an attributes= method that accepts a hash of attributes. The value side of the hash may be a proc. If so, it's evaluated at the time of the attributes= call. Using this so I can have a hash of defaults to reuse.</message>
  <tree>53038dcf6603e36741abb89b6a6e6d734d4fc9a9</tree>
  <committer>
    <name>Brian Cooke</name>
    <email>bcooke@roobasoft.com</email>
  </committer>
</commit>
