lib/hashme/properties.rb in hashme-0.2.1 vs lib/hashme/properties.rb in hashme-0.2.2
- old
+ new
@@ -11,14 +11,16 @@
self[name]
end
def set_attribute(name, value)
property = get_property(name)
- if property.nil?
- self[name.to_sym] = value
- else
+ if property
self[property.name] = property.build(self, value)
end
+ end
+
+ def attributes=(attrs = {})
+ set_attributes(attrs)
end
protected
# Go through each property and make sure it has a default value.