Class: Crawl::Failure
- Inherits:
-
Object
- Object
- Crawl::Failure
- Defined in:
- lib/crawl/failure.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#link ⇒ Object
readonly
Returns the value of attribute link.
Instance Method Summary collapse
- #error? ⇒ Boolean
- #failure? ⇒ Boolean
-
#initialize(link, code, from) ⇒ Failure
constructor
A new instance of Failure.
- #location ⇒ Object
- #message ⇒ Object
- #name ⇒ Object
Constructor Details
#initialize(link, code, from) ⇒ Failure
Returns a new instance of Failure.
5 6 7 8 9 |
# File 'lib/crawl/failure.rb', line 5 def initialize(link, code, from) @link = link @code = code @from = from end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
3 4 5 |
# File 'lib/crawl/failure.rb', line 3 def code @code end |
#from ⇒ Object (readonly)
Returns the value of attribute from.
3 4 5 |
# File 'lib/crawl/failure.rb', line 3 def from @from end |
#link ⇒ Object (readonly)
Returns the value of attribute link.
3 4 5 |
# File 'lib/crawl/failure.rb', line 3 def link @link end |
Instance Method Details
#error? ⇒ Boolean
15 16 17 |
# File 'lib/crawl/failure.rb', line 15 def error? !failure? end |
#failure? ⇒ Boolean
11 12 13 |
# File 'lib/crawl/failure.rb', line 11 def failure? true end |
#location ⇒ Object
27 28 29 |
# File 'lib/crawl/failure.rb', line 27 def location "Linked from #{from}" end |
#message ⇒ Object
23 24 25 |
# File 'lib/crawl/failure.rb', line 23 def "Status code was #{code}" end |
#name ⇒ Object
19 20 21 |
# File 'lib/crawl/failure.rb', line 19 def name link end |