def search(query,type = nil)
      checking_type(type)
      type = set_type(type) unless type.nil?
      if query.nil?
        puts 'Enter the text to search'
        text = gets
      end
      json = JSON.parse(connect_google(@api_key,type,query))
      @total_count = json["totalItems"]
      @items = json["items"]
    end
def search(query,type = nil)
      checking_type(type)
      type = set_type(type) unless type.nil?
      if query.nil?
        puts 'Enter the text to search'
        text = gets
      end
      json = JSON.parse(connect_google(@api_key,type,query))
      @total_count = json["totalItems"]
      @items = json["items"]
    end
Google books search