From edc61e9cb4571f6cb194dadb2dceb8e6ff5cbe83 Mon Sep 17 00:00:00 2001 From: Matchu Date: Thu, 25 Apr 2013 16:39:13 -0500 Subject: [PATCH] fix NoMethodError when pet not found Looks like I forgot to update the RemoteGateway code to consider that RocketAMF now returns strings. Like in the Pet code, I opted to dump it into a HashWithIndifferentAccess rather than assume that we'll forever use strings and it'll never get switched back to symbols. --- lib/rocketamf/remote_gateway/request.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rocketamf/remote_gateway/request.rb b/lib/rocketamf/remote_gateway/request.rb index 39cff159..c289f69a 100644 --- a/lib/rocketamf/remote_gateway/request.rb +++ b/lib/rocketamf/remote_gateway/request.rb @@ -49,7 +49,7 @@ module RocketAMF raise ConnectionError, e.message, e.backtrace end - first_message_data = result.messages[0].data + first_message_data = HashWithIndifferentAccess.new(result.messages[0].data) if first_message_data.respond_to?(:[]) && first_message_data[:code] == ERROR_CODE raise AMFError.new(first_message_data) end