Class: Crawl::Failure

Inherits:
Object
  • Object
show all
Defined in:
lib/crawl/failure.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#codeObject (readonly)

Returns the value of attribute code.



3
4
5
# File 'lib/crawl/failure.rb', line 3

def code
  @code
end

#fromObject (readonly)

Returns the value of attribute from.



3
4
5
# File 'lib/crawl/failure.rb', line 3

def from
  @from
end

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

Returns:

  • (Boolean)


15
16
17
# File 'lib/crawl/failure.rb', line 15

def error?
  !failure?
end

#failure?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/crawl/failure.rb', line 11

def failure?
  true
end

#locationObject



27
28
29
# File 'lib/crawl/failure.rb', line 27

def location
  "Linked from #{from}"
end

#messageObject



23
24
25
# File 'lib/crawl/failure.rb', line 23

def message
  "Status code was #{code}"
end

#nameObject



19
20
21
# File 'lib/crawl/failure.rb', line 19

def name
  link
end