Class: Crawlscope::Rules::Links::LinkTarget
- Inherits:
-
Data
- Object
- Data
- Crawlscope::Rules::Links::LinkTarget
- Defined in:
- lib/crawlscope/rules/links.rb
Instance Method Summary collapse
- #allowed?(statuses) ⇒ Boolean
- #final_path ⇒ Object
- #final_url ⇒ Object
- #ignored_error? ⇒ Boolean
- #redirect? ⇒ Boolean
- #status ⇒ Object
- #unresolved? ⇒ Boolean
Instance Method Details
#allowed?(statuses) ⇒ Boolean
175 176 177 |
# File 'lib/crawlscope/rules/links.rb', line 175 def allowed?(statuses) statuses.include?(status) end |
#final_path ⇒ Object
179 180 181 |
# File 'lib/crawlscope/rules/links.rb', line 179 def final_path Url.path(final_url) end |
#final_url ⇒ Object
183 184 185 186 |
# File 'lib/crawlscope/rules/links.rb', line 183 def final_url value = resolution[:final_url].to_s value.empty? ? target_url : value end |
#ignored_error? ⇒ Boolean
188 189 190 |
# File 'lib/crawlscope/rules/links.rb', line 188 def ignored_error? resolution && status.nil? && resolution[:crawled] && resolution[:error] end |
#redirect? ⇒ Boolean
196 197 198 |
# File 'lib/crawlscope/rules/links.rb', line 196 def redirect? (status && (300..399).cover?(status.to_i)) || final_url != target_url end |
#status ⇒ Object
192 193 194 |
# File 'lib/crawlscope/rules/links.rb', line 192 def status resolution && resolution[:status] end |
#unresolved? ⇒ Boolean
200 201 202 |
# File 'lib/crawlscope/rules/links.rb', line 200 def unresolved? resolution.nil? || (status.nil? && !ignored_error?) end |