class DMMCrawler::Attributes::DojinAttributes
Public Instance Methods
to_a()
click to toggle source
# File lib/dmm-crawler/attributes/dojin_attributes.rb, line 6 def to_a [ title, title_link, image_url, submedia, author, affiliateable?, tags ] end
Private Instance Methods
brand()
click to toggle source
# File lib/dmm-crawler/attributes/dojin_attributes.rb, line 53 def brand @page.search('.head-detail table tr td').take(8).last end
image_url()
click to toggle source
# File lib/dmm-crawler/attributes/dojin_attributes.rb, line 29 def image_url attrs = @page.search('.productPreview__item img').first.attributes if attrs['data-src'] attrs['data-src'].value else attrs['src'].value end end
submedia()
click to toggle source
# File lib/dmm-crawler/attributes/dojin_attributes.rb, line 39 def submedia @page .search('.productAttribute-listItem .c_icon_productGenre') .first .attributes['class'] .value .gsub('c_icon_productGenre ', '') .delete('-') end
title()
click to toggle source
# File lib/dmm-crawler/attributes/dojin_attributes.rb, line 20 def title @page.search('.productTitle__txt span').remove @page.search('.productTitle__txt').text.strip end
title_link()
click to toggle source
# File lib/dmm-crawler/attributes/dojin_attributes.rb, line 25 def title_link @page.uri.to_s end