def embed(name, model)
      embedding << name unless embedding.include?(name)

      define_method(name) do
        return nil unless @embedding.has_key? name
        @_memo[name] ||= begin
                           model = Ork::Utils.const(self.class, model)
                           new_embedded model, @embedding[name]
                         end
      end

      define_method(:"#{name}=") do |object|
        assert_embeddable object

        @embedding[name] = object.attributes
        object.__parent = self

        @_memo[name] = object
      end
    end
def embed(name, model)
      embedding << name unless embedding.include?(name)

      define_method(name) do
        return nil unless @embedding.has_key? name
        @_memo[name] ||= begin
                           model = Ork::Utils.const(self.class, model)
                           new_embedded model, @embedding[name]
                         end
      end

      define_method(:"#{name}=") do |object|
        assert_embeddable object

        @embedding[name] = object.attributes
        object.__parent = self

        @_memo[name] = object
      end
    end
A macro for defining an attribute, and the accessors
 for a given model.

 Example:

   class Post
     include Ork::Document

     embed :author, :Author
   end

   # It's the same as:

   class Post
     include Ork::Document

     def author
       @embedding[:author]
     end

     def author=(author)
       @embedding[:author] = author
       author.__parent = self
     end
   end