Class: CourseraDownloader::Document
- Inherits:
-
Object
- Object
- CourseraDownloader::Document
- Defined in:
- lib/coursera_downloader/document.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#content_type ⇒ Object
readonly
Returns the value of attribute content_type.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(url, body, content_type) ⇒ Document
constructor
A new instance of Document.
- #is_css? ⇒ Boolean
- #is_html? ⇒ Boolean
- #is_javascript? ⇒ Boolean
Constructor Details
#initialize(url, body, content_type) ⇒ Document
Returns a new instance of Document.
8 9 10 11 12 |
# File 'lib/coursera_downloader/document.rb', line 8 def initialize(url, body, content_type) @url = url @body = body @content_type = content_type end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
6 7 8 |
# File 'lib/coursera_downloader/document.rb', line 6 def body @body end |
#content_type ⇒ Object (readonly)
Returns the value of attribute content_type.
5 6 7 |
# File 'lib/coursera_downloader/document.rb', line 5 def content_type @content_type end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
5 6 7 |
# File 'lib/coursera_downloader/document.rb', line 5 def url @url end |
Instance Method Details
#is_css? ⇒ Boolean
18 19 20 |
# File 'lib/coursera_downloader/document.rb', line 18 def is_css? content_type =~ /text\/css/ end |
#is_html? ⇒ Boolean
14 15 16 |
# File 'lib/coursera_downloader/document.rb', line 14 def is_html? content_type =~ /text\/html/ end |
#is_javascript? ⇒ Boolean
22 23 24 |
# File 'lib/coursera_downloader/document.rb', line 22 def is_javascript? content_type =~ /javascript/ end |