Class: FileGrabber::DocumentPage
- Inherits:
-
Object
- Object
- FileGrabber::DocumentPage
- Defined in:
- lib/filegrabber/document_page.rb
Instance Attribute Summary collapse
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
Instance Method Summary collapse
-
#initialize(link) ⇒ DocumentPage
constructor
A new instance of DocumentPage.
- #link(selector) ⇒ Object
Constructor Details
#initialize(link) ⇒ DocumentPage
Returns a new instance of DocumentPage.
9 10 11 12 |
# File 'lib/filegrabber/document_page.rb', line 9 def initialize link @filename = link.inner_text @url = link['href'] end |
Instance Attribute Details
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
7 8 9 |
# File 'lib/filegrabber/document_page.rb', line 7 def filename @filename end |
Instance Method Details
#link(selector) ⇒ Object
14 15 16 |
# File 'lib/filegrabber/document_page.rb', line 14 def link selector URI.parse download_anchor(selector)['href'] end |