Class: Movies::Search

Inherits:
Object
  • Object
show all
Defined in:
lib/movies.rb

Instance Method Summary collapse

Instance Method Details

#agentObject



14
15
16
# File 'lib/movies.rb', line 14

def agent
  Mechanize.new
end


6
7
8
# File 'lib/movies.rb', line 6

def film_links
  page.links_with(class: 'film-name')
end

#filmsObject



10
11
12
# File 'lib/movies.rb', line 10

def films
  film_links.map(&:text)
end

#pageObject



18
19
20
# File 'lib/movies.rb', line 18

def page
  agent.get("http://www.123phim.vn/phim")
end