lib/taiwanese_news_parser/url_cleaner.rb
def clean(url)
    @url = Addressable::URI.parse(url)
    params = @url.query_values
    if params
      params.keep_if{|k,v| @white_list.include?(k) }
    end
    @url.query_values = params
    @url.to_s
  end
# white_list: Array of string, denoting url query 
# parameters that cleaner should keep
Array of string, denoting url query
parameters that cleaner should keep
Array of string denoting url query parameters that cleaner should keep
def clean(url)
    @url = Addressable::URI.parse(url)
    params = @url.query_values
    if params
      params.keep_if{|k,v| @white_list.include?(k) }
    end
    @url.query_values = params
    @url.to_s
  end
def clean ( url ) @url = Addressable :: URI . parse ( url ) params = @url . query_values if params params . keep_if { | k , v | @white_list . include? ( k ) } end @url . query_values = params @url . to_s end
white_list: Array of string, denoting url query
parameters that cleaner should keep
white_list : Array of string denoting url query parameters that cleaner should keep
url