Created
January 6, 2014 06:12
-
-
Save jessereynolds/8278928 to your computer and use it in GitHub Desktop.
ruby object to json issues
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| response_data = | |
| {"contacts" => | |
| contacts.collect {|contact| | |
| contact.linked_entity_ids = linked_entity_ids[contact.id] | |
| contact | |
| }, | |
| "linked" => { | |
| "entities" => linked_entity_data | |
| } | |
| } | |
| logger.info("response_data: #{response_data}") | |
| Oj.default_options = { :indent => 0, :mode => :compat } | |
| Oj.dump(response_data) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "contacts": [ | |
| { | |
| "redis": { | |
| "size": 2, | |
| "reserved": {}, | |
| "available": [ | |
| { | |
| "client": { | |
| "options": { | |
| "db": 13, | |
| "host": "127.0.0.1", | |
| "port": 6379, | |
| "url": null, | |
| "scheme": "redis", | |
| "path": null, | |
| "timeout": 5.0, | |
| "password": null, | |
| "driver": "Redis::Connection::Synchrony", | |
| "id": null, | |
| "tcp_keepalive": 0 | |
| }, | |
| "reconnect": true, | |
| "logger": null, | |
| "connection": null, | |
| "command_map": {} | |
| }, | |
| "original_client": { | |
| "options": { | |
| "db": 13, | |
| "host": "127.0.0.1", | |
| "port": 6379, | |
| "url": null, | |
| "scheme": "redis", | |
| "path": null, | |
| "timeout": 5.0, | |
| "password": null, | |
| "driver": "Redis::Connection::Synchrony", | |
| "id": null, | |
| "tcp_keepalive": 0 | |
| }, | |
| "reconnect": true, | |
| "logger": null, | |
| "connection": null, | |
| "command_map": {} | |
| }, | |
| "mon_owner": null, | |
| "mon_count": 0, | |
| "mon_mutex": {} | |
| }, | |
| { | |
| "client": { | |
| "options": { | |
| "db": 13, | |
| "host": "127.0.0.1", | |
| "port": 6379, | |
| "url": null, | |
| "scheme": "redis", | |
| "path": null, | |
| "timeout": 5.0, | |
| "password": null, | |
| "driver": "Redis::Connection::Synchrony", | |
| "id": null, | |
| "tcp_keepalive": 0 | |
| }, | |
| "reconnect": true, | |
| "logger": null, | |
| "connection": { | |
| "connection": { | |
| "signature": 29, | |
| "req": { | |
| "deferred_status": "succeeded", | |
| "callbacks": [], | |
| "errbacks": [ | |
| {} | |
| ], | |
| "deferred_timeout": null, | |
| "deferred_args": [ | |
| [ | |
| "reply", | |
| 1 | |
| ] | |
| ] | |
| }, | |
| "connected": true, | |
| "reader": {}, | |
| "deferred_status": "succeeded", | |
| "callbacks": [], | |
| "errbacks": [], | |
| "deferred_timeout": null, | |
| "deferred_args": [] | |
| }, | |
| "timeout": 5.0 | |
| }, | |
| "command_map": {}, | |
| "pid": 63804 | |
| }, | |
| "original_client": { | |
| "options": { | |
| "db": 13, | |
| "host": "127.0.0.1", | |
| "port": 6379, | |
| "url": null, | |
| "scheme": "redis", | |
| "path": null, | |
| "timeout": 5.0, | |
| "password": null, | |
| "driver": "Redis::Connection::Synchrony", | |
| "id": null, | |
| "tcp_keepalive": 0 | |
| }, | |
| "reconnect": true, | |
| "logger": null, | |
| "connection": { | |
| "connection": { | |
| "signature": 29, | |
| "req": { | |
| "deferred_status": "succeeded", | |
| "callbacks": [], | |
| "errbacks": [ | |
| {} | |
| ], | |
| "deferred_timeout": null, | |
| "deferred_args": [ | |
| [ | |
| "reply", | |
| 1 | |
| ] | |
| ] | |
| }, | |
| "connected": true, | |
| "reader": {}, | |
| "deferred_status": "succeeded", | |
| "callbacks": [], | |
| "errbacks": [], | |
| "deferred_timeout": null, | |
| "deferred_args": [] | |
| }, | |
| "timeout": 5.0 | |
| }, | |
| "command_map": {}, | |
| "pid": 63804 | |
| }, | |
| "mon_owner": null, | |
| "mon_count": 0, | |
| "mon_mutex": {} | |
| } | |
| ], | |
| "pending": [] | |
| }, | |
| "id": "515fa769-2c04-4c6c-ae7d-8ee062c7fc4e", | |
| "logger": null, | |
| "first_name": "Ada", | |
| "last_name": "Sausage", | |
| "email": "ada@example.com", | |
| "media": { | |
| "sms": "", | |
| "email": "" | |
| }, | |
| "media_intervals": {}, | |
| "media_rollup_thresholds": {}, | |
| "linked_entity_ids": null | |
| }, | |
| { | |
| "redis": { | |
| "size": 2, | |
| "reserved": {}, | |
| "available": [ | |
| { | |
| "client": { | |
| "options": { | |
| "db": 13, | |
| "host": "127.0.0.1", | |
| "port": 6379, | |
| "url": null, | |
| "scheme": "redis", | |
| "path": null, | |
| "timeout": 5.0, | |
| "password": null, | |
| "driver": "Redis::Connection::Synchrony", | |
| "id": null, | |
| "tcp_keepalive": 0 | |
| }, | |
| "reconnect": true, | |
| "logger": null, | |
| "connection": null, | |
| "command_map": {} | |
| }, | |
| "original_client": { | |
| "options": { | |
| "db": 13, | |
| "host": "127.0.0.1", | |
| "port": 6379, | |
| "url": null, | |
| "scheme": "redis", | |
| "path": null, | |
| "timeout": 5.0, | |
| "password": null, | |
| "driver": "Redis::Connection::Synchrony", | |
| "id": null, | |
| "tcp_keepalive": 0 | |
| }, | |
| "reconnect": true, | |
| "logger": null, | |
| "connection": null, | |
| "command_map": {} | |
| }, | |
| "mon_owner": null, | |
| "mon_count": 0, | |
| "mon_mutex": {} | |
| }, | |
| { | |
| "client": { | |
| "options": { | |
| "db": 13, | |
| "host": "127.0.0.1", | |
| "port": 6379, | |
| "url": null, | |
| "scheme": "redis", | |
| "path": null, | |
| "timeout": 5.0, | |
| "password": null, | |
| "driver": "Redis::Connection::Synchrony", | |
| "id": null, | |
| "tcp_keepalive": 0 | |
| }, | |
| "reconnect": true, | |
| "logger": null, | |
| "connection": { | |
| "connection": { | |
| "signature": 29, | |
| "req": { | |
| "deferred_status": "succeeded", | |
| "callbacks": [], | |
| "errbacks": [ | |
| {} | |
| ], | |
| "deferred_timeout": null, | |
| "deferred_args": [ | |
| [ | |
| "reply", | |
| 1 | |
| ] | |
| ] | |
| }, | |
| "connected": true, | |
| "reader": {}, | |
| "deferred_status": "succeeded", | |
| "callbacks": [], | |
| "errbacks": [], | |
| "deferred_timeout": null, | |
| "deferred_args": [] | |
| }, | |
| "timeout": 5.0 | |
| }, | |
| "command_map": {}, | |
| "pid": 63804 | |
| }, | |
| "original_client": { | |
| "options": { | |
| "db": 13, | |
| "host": "127.0.0.1", | |
| "port": 6379, | |
| "url": null, | |
| "scheme": "redis", | |
| "path": null, | |
| "timeout": 5.0, | |
| "password": null, | |
| "driver": "Redis::Connection::Synchrony", | |
| "id": null, | |
| "tcp_keepalive": 0 | |
| }, | |
| "reconnect": true, | |
| "logger": null, | |
| "connection": { | |
| "connection": { | |
| "signature": 29, | |
| "req": { | |
| "deferred_status": "succeeded", | |
| "callbacks": [], | |
| "errbacks": [ | |
| {} | |
| ], | |
| "deferred_timeout": null, | |
| "deferred_args": [ | |
| [ | |
| "reply", | |
| 1 | |
| ] | |
| ] | |
| }, | |
| "connected": true, | |
| "reader": {}, | |
| "deferred_status": "succeeded", | |
| "callbacks": [], | |
| "errbacks": [], | |
| "deferred_timeout": null, | |
| "deferred_args": [] | |
| }, | |
| "timeout": 5.0 | |
| }, | |
| "command_map": {}, | |
| "pid": 63804 | |
| }, | |
| "mon_owner": null, | |
| "mon_count": 0, | |
| "mon_mutex": {} | |
| } | |
| ], | |
| "pending": [] | |
| }, | |
| "id": "29ebf8d3-e92d-431c-84a8-01e93bfe7229", | |
| "logger": null, | |
| "first_name": "fjkdl", | |
| "last_name": "lskdjf", | |
| "email": "fjkdls", | |
| "media": {}, | |
| "media_intervals": {}, | |
| "media_rollup_thresholds": {}, | |
| "linked_entity_ids": null | |
| } | |
| ], | |
| "linked": { | |
| "entities": [] | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment