Class: Linkey::SaveLinks

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, file_name) ⇒ SaveLinks

Returns a new instance of SaveLinks.



38
39
40
41
# File 'lib/linkey.rb', line 38

def initialize(url, file_name)
  @url = url
  @file_name = file_name
end

Instance Attribute Details

#file_nameObject

Returns the value of attribute file_name.



36
37
38
# File 'lib/linkey.rb', line 36

def file_name
  @file_name
end

#urlObject

Returns the value of attribute url.



36
37
38
# File 'lib/linkey.rb', line 36

def url
  @url
end

Instance Method Details



47
48
49
# File 'lib/linkey.rb', line 47

def capture_links
  puts `phantomjs "#{js_file}" "#{url}" > "#{file_name}"`
end

#js_fileObject



43
44
45
# File 'lib/linkey.rb', line 43

def js_file
  File.expand_path("linkey/javascript/snap.js", File.dirname(__FILE__))
end