Class: Omelete::MovieTheaterAgent

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

Instance Method Summary collapse

Constructor Details

#initialize(omelete_id) ⇒ MovieTheaterAgent

Returns a new instance of MovieTheaterAgent.



11
12
13
14
15
# File 'lib/omelete/movie_theater_agent.rb', line 11

def initialize(omelete_id)
  client = Client.new
  @id = omelete_id
  @page_doc = client.page_doc("cinema/#{@id}")
end

Instance Method Details

#movie_theaterObject



17
18
19
20
21
22
23
24
25
# File 'lib/omelete/movie_theater_agent.rb', line 17

def movie_theater
  if @page_doc
    name = @page_doc.css("div[class='programacao_cinema'] h2 a").text
    values = @page_doc.css("div#tab_#{@id}_ingressos dl dd").text
    @movie_theater = MovieTheaterInfo.new @id, name, values
  else
    nil
  end
end