Class: Crawlscope::Rules::Links::LinkTarget

Inherits:
Data
  • Object
show all
Defined in:
lib/crawlscope/rules/links.rb

Instance Method Summary collapse

Instance Method Details

#allowed?(statuses) ⇒ Boolean

Returns:

  • (Boolean)


165
166
167
# File 'lib/crawlscope/rules/links.rb', line 165

def allowed?(statuses)
  statuses.include?(status)
end

#final_pathObject



169
170
171
# File 'lib/crawlscope/rules/links.rb', line 169

def final_path
  Url.path(final_url)
end

#final_urlObject



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

Returns:

  • (Boolean)


178
179
180
# File 'lib/crawlscope/rules/links.rb', line 178

def ignored_error?
  resolution && status.nil? && resolution[:crawled] && resolution[:error]
end

#statusObject



182
183
184
# File 'lib/crawlscope/rules/links.rb', line 182

def status
  resolution && resolution[:status]
end

#unresolved?Boolean

Returns:

  • (Boolean)


186
187
188
# File 'lib/crawlscope/rules/links.rb', line 186

def unresolved?
  resolution.nil? || (status.nil? && !ignored_error?)
end