   #TODO: maybe should use Attributes class and put this method into it.
   attrKeys: ->
     result = []
-    for k,v of @attributes
+    for k,v of @attributes.value()
       result.push v.name || k if v.enumerable isnt false
     result
   attrOwnPropertyNames: ->
     result = []
-    for k,v of @attributes
+    for k,v of @attributes.value()
       result.push v.name
     result
   # Returns

createObject    = require 'inherits-ex/lib/createObject'
inheritsObject  = require 'inherits-ex/lib/inheritsObject'
setPrototypeOf  = require 'inherits-ex/lib/setPrototypeOf'
defineProperty  = require 'util-ex/lib/defineProperty'
isString        = require 'util-ex/lib/is/type/string'
isObject        = require 'util-ex/lib/is/type/object'
isEmptyObject   = require 'util-ex/lib/is/empty-object'
extend          = require 'util-ex/lib/_extend'
Attributes      = require 'abstract-type/lib/attributes'
AttributeType   = require './attribute-type'
Type            = require 'abstract-type'
ObjectValue     = require './value'
register        = Type.register
aliases         = Type.aliases


    result = isObject aValue
    if result
      if aOptions and aOptions.attributes
        for vName, vType of aOptions.attributes.value()
          if vType.writable and !vType.set and aValue[vName] isnt undefined
            aValue[vName] = vType.toValue aValue[vName]
          if not vType.validate aValue[vName], false
