lib/imgurr/command.rb
# Public: Delete image from imgur
#
# Returns nothing
Delete image from imgur
Returns nothing
Delete image from imgur Returns nothing
def delete(major,minor)
        major = major.to_sym
        if minor
          delete_hash = minor
        else
          if storage.hash_exists?(major)
            delete_hash = storage.find(major)
          else
            puts 'Delete hash not found in storage.'
            puts 'Use: imgurr delete <id> <delete_hash>'
            return
          end
        end
        if ImgurAPI.delete(delete_hash)
          puts 'Successfully deleted image from Imgur'
          storage.delete(major)
          storage.save
        else
          puts 'Unauthorized Access. Wrong delete hash?'
        end
      end
def delete ( major , minor ) major = major . to_sym if minor delete_hash = minor else if storage . hash_exists? ( major ) delete_hash = storage . find ( major ) else puts 'Delete hash not found in storage.' puts 'Use: imgurr delete <id> <delete_hash>' return end end if ImgurAPI . delete ( delete_hash ) puts 'Successfully deleted image from Imgur' storage . delete ( major ) storage . save else puts 'Unauthorized Access. Wrong delete hash?' end end
Public: Delete image from imgur
Returns nothing
Public : Delete image from imgur Returns nothing
major
<not_specific>
minor
<not_specific>