Class: Linksta::SaveLinks
- Inherits:
-
Object
- Object
- Linksta::SaveLinks
- Defined in:
- lib/linksta.rb
Instance Attribute Summary collapse
-
#file_name ⇒ Object
Returns the value of attribute file_name.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #capture_links ⇒ Object
-
#initialize(url, file_name) ⇒ SaveLinks
constructor
A new instance of SaveLinks.
- #js_file ⇒ Object
Constructor Details
#initialize(url, file_name) ⇒ SaveLinks
Returns a new instance of SaveLinks.
38 39 40 41 |
# File 'lib/linksta.rb', line 38 def initialize(url, file_name) @url = url @file_name = file_name end |
Instance Attribute Details
#file_name ⇒ Object
Returns the value of attribute file_name.
36 37 38 |
# File 'lib/linksta.rb', line 36 def file_name @file_name end |
#url ⇒ Object
Returns the value of attribute url.
36 37 38 |
# File 'lib/linksta.rb', line 36 def url @url end |
Instance Method Details
#capture_links ⇒ Object
47 48 49 |
# File 'lib/linksta.rb', line 47 def capture_links puts `phantomjs "#{js_file}" "#{url}" > "#{file_name}"` end |
#js_file ⇒ Object
43 44 45 |
# File 'lib/linksta.rb', line 43 def js_file File.("linksta/javascript/snap.js", File.dirname(__FILE__)) end |