rubyx/lib/sof/hash.rb

13 lines
255 B
Ruby
Raw Normal View History

2014-08-15 16:14:49 +02:00
Hash.class_eval do
def to_sof_node(writer , level)
2014-08-16 14:16:07 +02:00
node = Sof::NodeList.new()
2014-08-16 11:34:25 +02:00
each do |key , object|
k = key.to_sof() + ": "
v = writer.to_sof_node( object )
2014-08-16 14:16:07 +02:00
v.data = "#{k}#{v.data}"
node.add v
2014-08-15 16:14:49 +02:00
end
2014-08-16 14:16:07 +02:00
node
2014-08-15 16:14:49 +02:00
end
end