lib/imgurr/imgurAPI.rb
# Public: Handle API Response: Get image Info
#
# args    - Response data
#
Handle API Response: Get image Info
args    - Response data
Handle API Response : Get image Info args - Response data
def handle_info_response(response)
        data = JSON.parse(response)
        puts JSON.pretty_unparse(data) if Imgurr::DEBUG
        if data['success']
          return "
            Image ID   : #{data['data']['id']}
            Views      : #{data['data']['views']}
            Bandwidth  : #{Numbers.to_human(data['data']['bandwidth'])}
            Title      : #{data['data']['title'].nil? ? 'None' : data['data']['title']}
            Desc       : #{data['data']['description'].nil? ? 'None' : data['data']['description']}
            Animated   : #{data['data']['animated']}
            Width      : #{data['data']['width']} px
            Height     : #{data['data']['height']} px
            Link       : #{data['data']['link']}
          ".gsub(/^ {8}/, '')
        end
        ImgurErrors.handle_error(response)
      end
def handle_info_response ( response ) data = JSON . parse ( response ) puts JSON . pretty_unparse ( data ) if Imgurr :: DEBUG if data [ 'success' ] return "
            Image ID   : #{data['data']['id']}
            Views      : #{data['data']['views']}
            Bandwidth  : #{Numbers.to_human(data['data']['bandwidth'])}
            Title      : #{data['data']['title'].nil? ? 'None' : data['data']['title']}
            Desc       : #{data['data']['description'].nil? ? 'None' : data['data']['description']}
            Animated   : #{data['data']['animated']}
            Width      : #{data['data']['width']} px
            Height     : #{data['data']['height']} px
            Link       : #{data['data']['link']}
          " . gsub ( / ^ {8} / , '' ) end ImgurErrors . handle_error ( response ) end
Public: Handle API Response: Get image Info
args    - Response data
Public : Handle API Response : Get image Info args - Response data
response
<not_specific>