Class: Archaeo::SaveResult

Inherits:
Object
  • Object
show all
Defined in:
lib/archaeo/save_result.rb

Overview

Model representing the outcome of a SavePageNow request.

Contains the resulting archive URL, timestamp, and whether the page was already cached in the archive.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(archive_url:, timestamp:, cached:) ⇒ SaveResult

Returns a new instance of SaveResult.



11
12
13
14
15
# File 'lib/archaeo/save_result.rb', line 11

def initialize(archive_url:, timestamp:, cached:)
  @archive_url = archive_url
  @timestamp = Timestamp.coerce(timestamp)
  @cached = cached
end

Instance Attribute Details

#archive_urlObject (readonly)

Returns the value of attribute archive_url.



9
10
11
# File 'lib/archaeo/save_result.rb', line 9

def archive_url
  @archive_url
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



9
10
11
# File 'lib/archaeo/save_result.rb', line 9

def timestamp
  @timestamp
end

Instance Method Details

#cached?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/archaeo/save_result.rb', line 17

def cached?
  @cached
end