Class: Linksta::CheckResponse
- Inherits:
-
Object
- Object
- Linksta::CheckResponse
- Defined in:
- lib/linksta.rb
Instance Attribute Summary collapse
-
#base ⇒ Object
Returns the value of attribute base.
-
#file_name ⇒ Object
Returns the value of attribute file_name.
-
#reg ⇒ Object
Returns the value of attribute reg.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #check_links ⇒ Object
-
#initialize(url, base, reg, file_name) ⇒ CheckResponse
constructor
A new instance of CheckResponse.
- #links(links) ⇒ Object
- #scan(page_links) ⇒ Object
Constructor Details
#initialize(url, base, reg, file_name) ⇒ CheckResponse
Returns a new instance of CheckResponse.
11 12 13 14 15 16 |
# File 'lib/linksta.rb', line 11 def initialize(url, base, reg, file_name) @url = url @base = base @reg = reg @file_name = file_name end |
Instance Attribute Details
#base ⇒ Object
Returns the value of attribute base.
9 10 11 |
# File 'lib/linksta.rb', line 9 def base @base end |
#file_name ⇒ Object
Returns the value of attribute file_name.
9 10 11 |
# File 'lib/linksta.rb', line 9 def file_name @file_name end |
#reg ⇒ Object
Returns the value of attribute reg.
9 10 11 |
# File 'lib/linksta.rb', line 9 def reg @reg end |
#url ⇒ Object
Returns the value of attribute url.
9 10 11 |
# File 'lib/linksta.rb', line 9 def url @url end |
Instance Method Details
#check_links ⇒ Object
18 19 20 21 |
# File 'lib/linksta.rb', line 18 def check_links links_list = File.read(file_name).split(",") links(links_list) end |
#links(links) ⇒ Object
23 24 25 26 27 |
# File 'lib/linksta.rb', line 23 def links(links) links.each do |url_links| scan(url_links) end end |