Class: BeerList::Establishments::MuddyWaters

Inherits:
Establishment show all
Defined in:
lib/beer_list/establishments/muddy_waters.rb

Constant Summary collapse

URL =
'http://muddywatersmpls.com/booze.html'

Instance Attribute Summary

Attributes included from Listable

#page

Instance Method Summary collapse

Methods inherited from Establishment

#short_class_name

Methods included from Listable

#list, #short_class_name

Instance Method Details

#get_listObject



6
7
8
# File 'lib/beer_list/establishments/muddy_waters.rb', line 6

def get_list
  get_processed_list
end

#get_processed_listObject



14
15
16
17
18
19
# File 'lib/beer_list/establishments/muddy_waters.rb', line 14

def get_processed_list
  all = page.search('div.graphic_textbox_layout_style_default p').map(&:text)

  all.pop get_wine_count(all.reverse)
  all
end

#get_wine_count(ary = []) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/beer_list/establishments/muddy_waters.rb', line 21

def get_wine_count(ary=[])
  count = 0
  ary.each do |e|
    count += 1
    break count if e.empty?
  end
end

#urlObject



10
11
12
# File 'lib/beer_list/establishments/muddy_waters.rb', line 10

def url
  URL
end