lib/ably/models/paginated_result.rb in ably-0.8.14 vs lib/ably/models/paginated_result.rb in ably-0.8.15
- old
+ new
@@ -30,9 +30,14 @@
@raw_body = http_response.body
@each_block = each_block
@make_async = options.fetch(:async_blocking_operations, false)
@items = http_response.body
+ if @items.nil? || @items.to_s.strip.empty?
+ @items = []
+ end
+ @items = [@items] if @items.kind_of?(Hash)
+
@items = coerce_items_into(items, @coerce_into) if @coerce_into
@items = items.map { |item| yield item } if block_given?
end
# Retrieve the first page of results.