def credential=cr
      if File.exist?(cr) && File.file?(cr)
        cr = File.read cr
      end

      @credential = case cr
        when Hash, ActiveSupport::HashWithIndifferentAccess
          cr
        when String
          JSON.parse cr
        else
          raise "Invalid data type"
      end
    end
def credential=cr
      if File.exist?(cr) && File.file?(cr)
        cr = File.read cr
      end

      @credential = case cr
        when Hash, ActiveSupport::HashWithIndifferentAccess
          cr
        when String
          JSON.parse cr
        else
          raise "Invalid data type"
      end
    end
File name or json string or hash