class AudioBookCreator::PageDef
information on the format of the html page that is read
Attributes
body_path[RW]
chapter_path[RW]
invalid_urls[RW]
link_path[RW]
title_path[RW]
Public Class Methods
new(title_path = "h1", body_path = "p", link_path = "a", chapter_path = nil, invalid_urls = {})
click to toggle source
# File lib/audio_book_creator/page_def.rb, line 7 def initialize(title_path = "h1", body_path = "p", link_path = "a", chapter_path = nil, invalid_urls = {}) @title_path = title_path @body_path = body_path @link_path = link_path @chapter_path = chapter_path @invalid_urls = invalid_urls end
Public Instance Methods
chapter_links(page)
click to toggle source
# File lib/audio_book_creator/page_def.rb, line 19 def chapter_links(page) page.links(chapter_path).select { |href| !invalid_urls.include?(href) } end
page_links(page)
click to toggle source
# File lib/audio_book_creator/page_def.rb, line 15 def page_links(page) page.links(link_path).select { |href| !invalid_urls.include?(href) } end