From 0d84c3a61b42b4b8d05ea7301b3669ff13ef4921 Mon Sep 17 00:00:00 2001 From: Priyanka Hanumansetti Date: Thu, 29 Mar 2018 16:25:31 +0530 Subject: [PATCH] Ruby 2.4 support Made changes in code to be able to use this gem with ruby 2.4 --- .travis.yml | 1 + lib/instagram/response.rb | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3064f09d..61018eef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,6 @@ language: ruby rvm: + - 2.4 - 2.2 - 2.1 - 2.0 diff --git a/lib/instagram/response.rb b/lib/instagram/response.rb index 0d74b725..f767ba60 100644 --- a/lib/instagram/response.rb +++ b/lib/instagram/response.rb @@ -1,7 +1,11 @@ module Instagram module Response def self.create( response_hash, ratelimit_hash ) - data = response_hash.data.dup rescue response_hash + unless response_hash.data.nil? + data = response_hash.data.dup + else + data = response_hash + end data.extend( self ) data.instance_exec do %w{pagination meta}.each do |k|