adding a #to_h method for the Node object
This commit is contained in:
parent
0d71eb9e15
commit
e994597d42
1 changed files with 5 additions and 0 deletions
5
thing.rb
5
thing.rb
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue