lib/plaid/customer.rb
# This initializes our instance variables, and sets up a new Customer class.
This initializes our instance variables, and sets up a new Customer class.
This initializes our instance variables and sets up a new Customer class .
def parse_response(response,method)
      case method
      when 1
        case response.code
        when 200
          @parsed_response = Hash.new
          @parsed_response[:code] = response.code
          response = JSON.parse(response)
          @parsed_response[:access_token] = response["access_token"]
          @parsed_response[:accounts] = response["accounts"]
          @parsed_response[:transactions] = response["transactions"]
          return @parsed_response
        when 201  
          @parsed_response = Hash.new
          @parsed_response[:code] = response.code
          response = JSON.parse(response)
          @parsed_response = Hash.new
          @parsed_response[:type] = response["type"]
          @parsed_response[:access_token] = response["access_token"]
          @parsed_response[:mfa_info] = response["mfa"]
          return @parsed_response
        else
          @parsed_response = Hash.new
          @parsed_response[:code] = response.code
          @parsed_response[:message] = response
          return @parsed_response
        end
      when 2
        case response.code
        when 200
          @parsed_response = Hash.new
          @parsed_response[:code] = response.code
          response = JSON.parse(response)
          @parsed_response[:accounts] = response["accounts"]
          @parsed_response[:transactions] = response["transactions"]
          return @parsed_response
        else
          @parsed_response = Hash.new
          @parsed_response[:code] = response.code
          @parsed_response[:message] = response
          return @parsed_response
        end
      when 3
        case response.code
        when 200
          @parsed_response = Hash.new
          @parsed_response[:code] = response.code
          response = JSON.parse(response)
          @parsed_response[:message] = response
          return @parsed_response
        else
          @parsed_response = Hash.new
          @parsed_response[:code] = response.code
          @parsed_response[:message] = response
          return @parsed_response
        end
      end
    end
def parse_response ( response , method ) case method when 1 case response . code when 200 @parsed_response = Hash . new @parsed_response [ :code ] = response . code response = JSON . parse ( response ) @parsed_response [ :access_token ] = response [ "access_token" ] @parsed_response [ :accounts ] = response [ "accounts" ] @parsed_response [ :transactions ] = response [ "transactions" ] return @parsed_response when 201 @parsed_response = Hash . new @parsed_response [ :code ] = response . code response = JSON . parse ( response ) @parsed_response = Hash . new @parsed_response [ :type ] = response [ "type" ] @parsed_response [ :access_token ] = response [ "access_token" ] @parsed_response [ :mfa_info ] = response [ "mfa" ] return @parsed_response else @parsed_response = Hash . new @parsed_response [ :code ] = response . code @parsed_response [ :message ] = response return @parsed_response end when 2 case response . code when 200 @parsed_response = Hash . new @parsed_response [ :code ] = response . code response = JSON . parse ( response ) @parsed_response [ :accounts ] = response [ "accounts" ] @parsed_response [ :transactions ] = response [ "transactions" ] return @parsed_response else @parsed_response = Hash . new @parsed_response [ :code ] = response . code @parsed_response [ :message ] = response return @parsed_response end when 3 case response . code when 200 @parsed_response = Hash . new @parsed_response [ :code ] = response . code response = JSON . parse ( response ) @parsed_response [ :message ] = response return @parsed_response else @parsed_response = Hash . new @parsed_response [ :code ] = response . code @parsed_response [ :message ] = response return @parsed_response end end end
This initializes our instance variables, and sets up a new Customer class.
This initializes our instance variables and sets up a new Customer class .
response
<not_specific>
method
<not_specific>