lib/representable/xml/hash.rb in representable-2.3.0 vs lib/representable/xml/hash.rb in representable-2.4.0.rc1
- old
+ new
@@ -8,30 +8,35 @@
def self.included(base)
base.class_eval do
include Representable
extend ClassMethods
- representable_attrs.add(:_self, {:hash => true, :use_attributes => true})
+ property(:_self, hash: true, use_attributes: true)
end
end
module ClassMethods
def values(options)
hash :_self, options.merge!(:use_attributes => true)
end
end
+
+ def create_representation_with(doc, options, format)
+ bin = representable_bindings_for(format, options).first
+ bin.write(doc, super, options)
+ end
end
module Hash
include Representable::XML
include HashMethods
def self.included(base)
base.class_eval do
include Representable
extend ClassMethods
- representable_attrs.add(:_self, {:hash => true})
+ property(:_self, {:hash => true})
end
end
module ClassMethods