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
- #status ⇒ Object
- #unresolved? ⇒ Boolean
Instance Method Details
#allowed?(statuses) ⇒ Boolean
165 166 167 |
# File 'lib/crawlscope/rules/links.rb', line 165 def allowed?(statuses) statuses.include?(status) end |
#final_path ⇒ Object
169 170 171 |
# File 'lib/crawlscope/rules/links.rb', line 169 def final_path Url.path(final_url) end |
#final_url ⇒ Object
173 174 175 176 |
# File 'lib/crawlscope/rules/links.rb', line 173 def final_url value = resolution[:final_url].to_s value.empty? ? target_url : value end |
#ignored_error? ⇒ Boolean
178 179 180 |
# File 'lib/crawlscope/rules/links.rb', line 178 def ignored_error? resolution && status.nil? && resolution[:crawled] && resolution[:error] end |
#status ⇒ Object
182 183 184 |
# File 'lib/crawlscope/rules/links.rb', line 182 def status resolution && resolution[:status] end |
#unresolved? ⇒ Boolean
186 187 188 |
# File 'lib/crawlscope/rules/links.rb', line 186 def unresolved? resolution.nil? || (status.nil? && !ignored_error?) end |