Class: AtTheMovies::Parsers::Interview
Instance Attribute Summary
#page
Instance Method Summary
collapse
#initialize, parse
Instance Method Details
#date ⇒ Object
19
20
21
|
# File 'lib/at_the_movies/parsers/interview.rb', line 19
def date
Date.parse(@page.search('meta[@name="Date"]').first['content'].gsub('/', '-'))
end
|
#details ⇒ Object
11
12
13
|
# File 'lib/at_the_movies/parsers/interview.rb', line 11
def details
@page.body.scan(/(Margaret|David) interviews (.*).<\/p>\r/).flatten
end
|
#parse ⇒ Object
4
5
6
7
8
9
|
# File 'lib/at_the_movies/parsers/interview.rb', line 4
def parse
interviewer, interviewee = details
if interviewer && interviewee
AtTheMovies::Interview.new(title, date, interviewee, interviewer, @page.uri.to_s)
end
end
|
#title ⇒ Object
15
16
17
|
# File 'lib/at_the_movies/parsers/interview.rb', line 15
def title
@page.title.strip[15..-1]
end
|