Class: LinkChecker::Result
- Inherits:
-
Object
- Object
- LinkChecker::Result
show all
- Defined in:
- lib/ruby-link-checker/result.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(current_uri, method, original_uri, options = {}) ⇒ Result
Returns a new instance of Result.
5
6
7
8
9
10
|
# File 'lib/ruby-link-checker/result.rb', line 5
def initialize(current_uri, method, original_uri, options = {})
@uri = original_uri
@result_uri = current_uri
@method = method
@options = options
end
|
Instance Attribute Details
#checker ⇒ Object
Returns the value of attribute checker.
3
4
5
|
# File 'lib/ruby-link-checker/result.rb', line 3
def checker
@checker
end
|
#method ⇒ Object
Returns the value of attribute method.
3
4
5
|
# File 'lib/ruby-link-checker/result.rb', line 3
def method
@method
end
|
#options ⇒ Object
Returns the value of attribute options.
3
4
5
|
# File 'lib/ruby-link-checker/result.rb', line 3
def options
@options
end
|
#result_uri ⇒ Object
Returns the value of attribute result_uri.
3
4
5
|
# File 'lib/ruby-link-checker/result.rb', line 3
def result_uri
@result_uri
end
|
#uri ⇒ Object
Returns the value of attribute uri.
3
4
5
|
# File 'lib/ruby-link-checker/result.rb', line 3
def uri
@uri
end
|
Instance Method Details
#code ⇒ Object
36
37
38
|
# File 'lib/ruby-link-checker/result.rb', line 36
def code
nil
end
|
#error ⇒ Object
40
41
42
|
# File 'lib/ruby-link-checker/result.rb', line 40
def error
nil
end
|
#error? ⇒ Boolean
20
21
22
|
# File 'lib/ruby-link-checker/result.rb', line 20
def error?
false
end
|
#failure? ⇒ Boolean
16
17
18
|
# File 'lib/ruby-link-checker/result.rb', line 16
def failure?
false
end
|
#redirect? ⇒ Boolean
24
25
26
|
# File 'lib/ruby-link-checker/result.rb', line 24
def redirect?
false
end
|
#redirect_to ⇒ Object
28
29
30
|
# File 'lib/ruby-link-checker/result.rb', line 28
def redirect_to
nil
end
|
32
33
34
|
# File 'lib/ruby-link-checker/result.rb', line 32
def
{}
end
|
#success? ⇒ Boolean
12
13
14
|
# File 'lib/ruby-link-checker/result.rb', line 12
def success?
false
end
|
#to_s ⇒ Object
44
45
46
47
48
49
50
51
52
53
54
55
|
# File 'lib/ruby-link-checker/result.rb', line 44
def to_s
status_s = if success?
'OK'
elsif failure?
'FAIL'
elsif redirect?
'REDIRECT'
else
'ERROR'
end
"#{method} #{uri}#{result_uri == uri ? nil : ' (' + result_uri.to_s + ')'}: #{status_s} (#{code})"
end
|