diff --git a/resources/event_watch_def.rb b/resources/event_watch_def.rb index 93ec185d..1772d76f 100644 --- a/resources/event_watch_def.rb +++ b/resources/event_watch_def.rb @@ -33,9 +33,13 @@ def to_json def to_hash hash = { - type: "event" + watches:[ + { + type: 'event', + name: name, + handler: handler + } + ] } - hash[:name] = name - hash[:handler] = handler unless handler.nil? hash end diff --git a/resources/key_watch_def.rb b/resources/key_watch_def.rb index aae9efc3..4d698fba 100644 --- a/resources/key_watch_def.rb +++ b/resources/key_watch_def.rb @@ -34,9 +34,13 @@ def to_json def to_hash hash = { - type: "key" + watches:[ + { + type: 'key', + key: key, + handler: handler + } + ] } - hash[:key] = key - hash[:handler] = handler hash end