adding a #to_h method for the Node object

This commit is contained in:
Vincent Batts 2012-08-06 17:21:44 -04:00
parent 0d71eb9e15
commit e994597d42

View file

@ -100,6 +100,11 @@ class Node
def to_json(*a)
@children.to_json(*a)
end
def to_h
@children
Hash[@children.map {|k, v| [k, v.to_h] }]
end
end
def akamai_hex_to_content_set(akamai_hex)