lib/npr/api/response.rb in npr-0.1.1 vs lib/npr/api/response.rb in npr-0.1.2

- old
+ new

@@ -14,17 +14,20 @@ #-------------------------- def initialize(response) create_relations(response) - @raw = response - @version = response.body["version"] - if response.body["list"] - @list = NPR::Entity::List.new(response.body["list"]) + @_response = response + @raw = response.body + + @version = @raw["version"] + + if list = @raw["list"] + @list = NPR::Entity::List.new(list) end - Array.wrap(response.body["message"]).each do |message| + Array.wrap(@raw["message"]).each do |message| @messages.push NPR::API::Message.new(message) end end end # Response end # API