Class: Governator::Panel
Instance Attribute Summary
Attributes inherited from PageScraper
#raw
Instance Method Summary
collapse
Methods inherited from PageScraper
#initialize, #nbsp
Instance Method Details
#bio_page ⇒ Object
11
12
13
|
# File 'lib/governator/panel.rb', line 11
def bio_page
@_bio_page ||= raw.css('.governors-state a').first['href']
end
|
#governor_name ⇒ Object
15
16
17
18
19
20
21
|
# File 'lib/governator/panel.rb', line 15
def governor_name
@_governor_name ||= raw.css('.governors-state a')
.first
.text
.sub('Governor ', '')
.gsub(' ', ' ')
end
|
#image ⇒ Object
7
8
9
|
# File 'lib/governator/panel.rb', line 7
def image
@_image ||= raw.css('.governors-img img').first['src']
end
|
#state ⇒ Object
23
24
25
26
27
28
29
30
|
# File 'lib/governator/panel.rb', line 23
def state
state = raw.css('.governors-state h3').first.text
case state
when 'Northern Mariana Islands' then 'Commonwealth of the ' + state
when 'Virgin Islands' then 'United States ' + state
else state
end
end
|