Class: CourseraDownloader::DocumentProcessor
- Inherits:
-
Object
- Object
- CourseraDownloader::DocumentProcessor
- Defined in:
- lib/coursera_downloader/document_processor.rb
Constant Summary collapse
- DISABLED_HREF =
"javascript:alert('Link disabled during download.');"
Instance Attribute Summary collapse
-
#document ⇒ Object
readonly
Returns the value of attribute document.
-
#resource_urls ⇒ Object
readonly
Returns the value of attribute resource_urls.
Instance Method Summary collapse
-
#initialize(document, store, policy) ⇒ DocumentProcessor
constructor
A new instance of DocumentProcessor.
- #process ⇒ Object
Constructor Details
#initialize(document, store, policy) ⇒ DocumentProcessor
Returns a new instance of DocumentProcessor.
9 10 11 12 13 14 |
# File 'lib/coursera_downloader/document_processor.rb', line 9 def initialize(document, store, policy) @document = document @store = store @policy = policy @resource_urls = Set.new end |
Instance Attribute Details
#document ⇒ Object (readonly)
Returns the value of attribute document.
7 8 9 |
# File 'lib/coursera_downloader/document_processor.rb', line 7 def document @document end |
#resource_urls ⇒ Object (readonly)
Returns the value of attribute resource_urls.
7 8 9 |
# File 'lib/coursera_downloader/document_processor.rb', line 7 def resource_urls @resource_urls end |
Instance Method Details
#process ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/coursera_downloader/document_processor.rb', line 16 def process if @document.is_html? @document.body = process_html(@document.body) elsif @document.is_css? @document.body = process_css(@document.body) end end |