lib/usable/struct.rb in usable-3.8.0 vs lib/usable/struct.rb in usable-3.9.0
- old
+ new
@@ -24,8 +24,20 @@
end
def each(&block)
@attrs.each(&block)
end
+
+ def to_h
+ @attrs.dup
+ end
+
+ alias to_hash to_h
+
+ def merge(other)
+ to_h.merge!(other)
+ end
+
+ alias + merge
end
end
end