Class: FileGrabber::DocumentPage

Inherits:
Object
  • Object
show all
Defined in:
lib/filegrabber/document_page.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#filenameObject (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



14
15
16
# File 'lib/filegrabber/document_page.rb', line 14

def link selector
  URI.parse download_anchor(selector)['href']
end