class BeerList::Leads::BeerAdvocate
Constants
- BEERFLY
- LEAD_INDICATOR_TEXT
Public Instance Methods
links()
click to toggle source
# File lib/beer_list/leads/beer_advocate.rb, line 9 def links @links ||= [] pages end
Also aliased as: get_list
url()
click to toggle source
# File lib/beer_list/leads/beer_advocate.rb, line 15 def url "#{BEERFLY}?c_id=US&s_id=#{short_class_name}&bar=Y" end
Private Instance Methods
pages()
click to toggle source
# File lib/beer_list/leads/beer_advocate.rb, line 21 def pages @links += page.links_with(:text => LEAD_INDICATOR_TEXT).map(&:href) if next_link = page.links_with(:text => /next/).first self.page = next_link.click pages end @links end
short_class_name()
click to toggle source
# File lib/beer_list/leads/beer_advocate.rb, line 31 def short_class_name self.class.name.split('::').last end