lib/backchat_client/user.rb
##
# Return the user profile in case that the token provided is valid
# ==== Return
# * user profile with information about channels, streams and plan
# * nil if token is invalid or an unexpected error takes place
Return the user profile in case that the token provided is valid
Return
user profile with information about channels, streams and plan
nil if token is invalid or an unexpected error takes place
Return the user profile in case that the token provided is valid Return user profile with information about channels streams and plan nil if token is invalid or an unexpected error takes place
def find
      begin
        debug("Fetching user profile")
        data = get("index.json")
        if data.is_a?(String)
          data = ActiveSupport::JSON.decode(data)
          if data.has_key?("data")
            data["data"]
          else
            nil
          end
        end
      rescue BackchatClient::Error::ClientError => ex
        error "Invalid api_key #{@api_key}"
        nil 
      rescue Exception => ex
        logger.error " Unexpected error"
        logger.error ex.inspect
        nil 
      end
    end
def find begin debug ( "Fetching user profile" ) data = get ( "index.json" ) if data . is_a? ( String ) data = ActiveSupport :: JSON . decode ( data ) if data . has_key? ( "data" ) data [ "data" ] else nil end end rescue BackchatClient :: Error :: ClientError => ex error "Invalid api_key #{@api_key}" nil rescue Exception => ex logger . error " Unexpected error" logger . error ex . inspect nil end end
Return the user profile in case that the token provided is valid
 Return
 user profile with information about channels, streams and plan
 nil if token is invalid or an unexpected error takes place
Return the user profile in case that the token provided is valid Return user profile with information about channels streams and plan nil if token is invalid or an unexpected error takes place
# Invalid token # Unexpected error