Class: WaybackArchiver::Response

Inherits:
Struct
  • Object
show all
Defined in:
lib/wayback_archiver/response.rb,
lib/wayback_archiver/response.rb

Overview

Response data struct

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bodyObject

Returns the value of attribute body

Returns:

  • (Object)

    the current value of body



3
4
5
# File 'lib/wayback_archiver/response.rb', line 3

def body
  @body
end

#codeObject

Returns the value of attribute code

Returns:

  • (Object)

    the current value of code



3
4
5
# File 'lib/wayback_archiver/response.rb', line 3

def code
  @code
end

#errorObject

Returns the value of attribute error

Returns:

  • (Object)

    the current value of error



3
4
5
# File 'lib/wayback_archiver/response.rb', line 3

def error
  @error
end

#messageObject

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



3
4
5
# File 'lib/wayback_archiver/response.rb', line 3

def message
  @message
end

#uriObject

Returns the value of attribute uri

Returns:

  • (Object)

    the current value of uri



3
4
5
# File 'lib/wayback_archiver/response.rb', line 3

def uri
  @uri
end

Instance Method Details

#success?Boolean

Returns true if a successfull response

Examples:

check if Response was successfull

response = Response.new('200', 'OK', 'buren', 'http://example.com')
response.success? # => true

Returns:

  • (Boolean)


9
10
11
# File 'lib/wayback_archiver/response.rb', line 9

def success?
  HTTPCode.success?(code)
end