Add to_hash for ResourceLimits for serialization

This commit is contained in:
Justin Li
2015-05-12 14:27:26 -04:00
parent 8a8996387b
commit f2d760b0e9
2 changed files with 16 additions and 0 deletions
+6
View File
@@ -19,5 +19,11 @@ module Liquid
def reset
@render_length = @render_score = @assign_score = 0
end
def to_hash
instance_variables.each_with_object({}) do |key, hash|
hash[key.to_s[1..-1].to_sym] = instance_variable_get(key)
end
end
end
end