Class: OpenDMM::Engine::TokyoHot::MovieN

Inherits:
Movie
  • Object
show all
Defined in:
lib/opendmm/engines/tokyo_hot.rb

Instance Method Summary collapse

Methods inherited from Movie

#details

Constructor Details

#initialize(query) ⇒ MovieN

Returns a new instance of MovieN.



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/opendmm/engines/tokyo_hot.rb', line 36

def initialize(query)
  super(query, Site.list_n)

  @details.code         = "Tokyo Hot #{query}"
  @details.maker        = 'Tokyo Hot'

  link = @html.at_xpath("//a[contains(@href, '#{@query}')]")
  @details.page         = link['href']
  @details.cover_image  = link.at_css('img')['src']

  table = link.ancestors('table').first
  table.css('br').each do |br|
    br.replace "\n"
  end
  @details.title        = table.at_xpath('tr[1]').text
  @details.actresses    = table.at_xpath('tr[2]').text.squish.remove('--').split(/[\s、,]/)
  @details.release_date = table.at_xpath('tr[3]').text.remove('更新日')
end