Class: JustCrawl::Failure

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(link, code, from) ⇒ Failure

Returns a new instance of Failure.



6
7
8
9
10
# File 'lib/just_crawl/failure.rb', line 6

def initialize(link, code, from)
  @link = link
  @code = code
  @from = from
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



4
5
6
# File 'lib/just_crawl/failure.rb', line 4

def code
  @code
end

#fromObject (readonly)

Returns the value of attribute from.



4
5
6
# File 'lib/just_crawl/failure.rb', line 4

def from
  @from
end

Returns the value of attribute link.



4
5
6
# File 'lib/just_crawl/failure.rb', line 4

def link
  @link
end

Instance Method Details

#error?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/just_crawl/failure.rb', line 16

def error?
  !failure?
end

#failure?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/just_crawl/failure.rb', line 12

def failure?
  true
end

#locationObject



28
29
30
# File 'lib/just_crawl/failure.rb', line 28

def location
  "Linked from #{from}"
end

#messageObject



24
25
26
# File 'lib/just_crawl/failure.rb', line 24

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

#nameObject



20
21
22
# File 'lib/just_crawl/failure.rb', line 20

def name
  link
end