<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -27,18 +27,55 @@ module SemanticAttributes #:nodoc:
     end
 
     module ClassMethods
-      # converts the object into human format according to the predicates for the attribute.
-      # the object may really be anything: string, integer, date, etc.
-      def humanize(attr, obj)
-        self.semantic_attributes[attr].predicates.inject(obj) { |val, predicate| val = predicate.to_human(val) }
-      end
+        # def acts_as_semantic_attributes(options = {})
+        #   parse_options!(options)
+        #   add_callbacks
+        #   extend(ActsAsSemanticAttributesClassMethods)
+        #   send(:include, InstanceMethods)
+        # end
+
+      private
+
+        def parse_options!(options)
+          fail(&quot;Unknown option(s): #{ options.keys.join(', ') }&quot;) unless options.empty?
+        end
+
+        def add_callbacks
+          before_save :machinize_semantic_attributes
+          after_save :humanize_semantic_attributes
+          after_find :humanize_semantic_attributes
+          define_method(:after_find) { } 
+        end
+
+        module InstanceMethods
+          def humanize_semantic_attributes
+            semantic_attributes.each do |attribute|
+              attr_name = attribute.field.to_s
+              self[attr_name] = self.class.humanize(attr_name, @attributes[attr_name])
+            end
+          end
+
+          def machinize_semantic_attributes
+            semantic_attributes.each do |attribute|
+              attr_name = attribute.field.to_s
+              write_attribute attr_name, self.class.machinize(attr_name, @attributes[attr_name])
+            end
+          end
+        end
 
-      # converts the object into machine format according to the predicates for the attribute.
-      # the object should be a simple object like a string, array, or hash. but really, it depends on the the predicates.
-      def normalize(attr, obj)
-        self.semantic_attributes[attr].predicates.inject(obj) { |val, predicate| val = predicate.normalize(val) }
+      module ActsAsSemanticAttributesClassMethods
+        # converts the object into human format according to the predicates for the attribute.
+        # the object may really be anything: string, integer, date, etc.
+        def humanize(attr, obj)
+          self.semantic_attributes[attr].predicates.inject(obj) { |val, predicate| val = predicate.to_human(val) }
+        end
+
+        # converts the object into machine format according to the predicates for the attribute.
+        # the object should be a simple object like a string, array, or hash. but really, it depends on the the predicates.
+        def normalize(attr, obj)
+          self.semantic_attributes[attr].predicates.inject(obj) { |val, predicate| val = predicate.normalize(val) }
+        end
       end
-      
       protected
 
       def define_normalization_method_for(attr)</diff>
      <filename>lib/semantic_attributes/attribute_formats.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,12 +7,12 @@ en-us:
         required: 'is required.'
         exclusion: &quot;is not an allowed option.&quot;
         inclusion: &quot;is not an allowed option.&quot;
+        date: &quot;must be a valid date.&quot;
         domain: &quot;must be a simple domain.&quot;
         email: 'must be an email address.'
         hex: &quot;must be a hex color.&quot;
         invalid: &quot;is invalid.&quot;
         phone: &quot;must be a phone number.&quot;
-        date: &quot;must be a valid date.&quot;
         time: &quot;must be a point in time.&quot;
         taken: &quot;has already been taken.&quot;
         url: 'must be a valid URL.'</diff>
      <filename>lib/semantic_attributes/locale/en-us.yml</filename>
    </modified>
    <modified>
      <diff>@@ -7,6 +7,7 @@ en:
         required: 'is required.'
         exclusion: &quot;is not an allowed option.&quot;
         inclusion: &quot;is not an allowed option.&quot;
+        date: &quot;must be a valid date.&quot;
         domain: &quot;must be a simple domain.&quot;
         email: 'must be an email address.'
         hex: &quot;must be a hex color.&quot;</diff>
      <filename>lib/semantic_attributes/locale/en.yml</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>325739ff1bcf72962a139f2578b8e3835f426907</id>
    </parent>
  </parents>
  <author>
    <name>Edwin Moss</name>
    <email>edwin.moss@gmail.com</email>
  </author>
  <url>http://github.com/edwinmoss/semantic-attributes/commit/963a8de560d0c217fd9ca6e68eb7421b71587f4f</url>
  <id>963a8de560d0c217fd9ca6e68eb7421b71587f4f</id>
  <committed-date>2009-06-25T12:13:02-07:00</committed-date>
  <authored-date>2009-06-25T12:13:02-07:00</authored-date>
  <message>Finish up merge with core.</message>
  <tree>4750aa5d7f112a431ef69da5c82882f7034d95ab</tree>
  <committer>
    <name>Edwin Moss</name>
    <email>edwin.moss@gmail.com</email>
  </committer>
</commit>
