Class: WaybackArchiver::ArchiveResult

Inherits:
Object
  • Object
show all
Defined in:
lib/wayback_archiver/archive_result.rb

Overview

Result data for posting URL to archive

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri, code: nil, request_url: nil, response_error: nil, error: nil) ⇒ ArchiveResult

Returns a new instance of ArchiveResult.



6
7
8
9
10
11
12
# File 'lib/wayback_archiver/archive_result.rb', line 6

def initialize(uri, code: nil, request_url: nil, response_error: nil, error: nil)
  @uri = uri
  @code = code
  @request_url = request_url
  @response_error = response_error
  @error = error
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



4
5
6
# File 'lib/wayback_archiver/archive_result.rb', line 4

def code
  @code
end

#errorObject (readonly)

Returns the value of attribute error.



4
5
6
# File 'lib/wayback_archiver/archive_result.rb', line 4

def error
  @error
end

#request_urlObject (readonly)

Returns the value of attribute request_url.



4
5
6
# File 'lib/wayback_archiver/archive_result.rb', line 4

def request_url
  @request_url
end

#response_errorObject (readonly)

Returns the value of attribute response_error.



4
5
6
# File 'lib/wayback_archiver/archive_result.rb', line 4

def response_error
  @response_error
end

#uriObject (readonly)

Returns the value of attribute uri.



4
5
6
# File 'lib/wayback_archiver/archive_result.rb', line 4

def uri
  @uri
end

Instance Method Details

#archived_urlString

Returns the URL that was archived.

Returns:

  • (String)

    the URL that was archived



15
16
17
# File 'lib/wayback_archiver/archive_result.rb', line 15

def archived_url
  uri
end

#errored?Boolean

Returns true if errored.

Returns:

  • (Boolean)

    true if errored



25
26
27
# File 'lib/wayback_archiver/archive_result.rb', line 25

def errored?
  !!error
end

#success?Boolean

Returns true if success.

Returns:

  • (Boolean)

    true if success



20
21
22
# File 'lib/wayback_archiver/archive_result.rb', line 20

def success?
  !errored?
end