lib/hashie_model/base.rb in hashie-model-1.3.3 vs lib/hashie_model/base.rb in hashie-model-1.3.4
- old
+ new
@@ -61,9 +61,19 @@
self.class.properties.each do |key|
attrs[key] = self[key]
end
end
end
+
+ def dup
+ self.class.new(to_hash)
+ end
+
+ def merge(options)
+ h = to_hash
+ h.merge!(options.stringify_keys)
+ self.class.new(h)
+ end
def persisted?
false
end