lib/quorable.rb in quorable-0.1.3 vs lib/quorable.rb in quorable-0.1.4
- old
+ new
@@ -4,15 +4,15 @@
module Quorable
BASE_URL = 'http://www.quora.com'
def self.feed(topic)
- doc = Nokogiri::HTML.parse(open("#{BASE_URL}/#{parameterize(topic)}"))
+ doc = Nokogiri::HTML.parse(open("#{BASE_URL}/#{Quorable.parameterize(topic)}"))
paths = doc.css('.question_link').map { |link| link['href'] }
end
private
- def parameterize(topic)
+ def self.parameterize(topic)
topic.split(' ').map(&:downcase).map(&:capitalize).join('-')
end
end
\ No newline at end of file