Class: Archaeo::AvailabilityResult

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

Overview

Model representing the result of an availability query.

Indicates whether a URL is archived and, if so, provides the closest snapshot’s archive URL and timestamp.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url:, available:, archive_url: nil, timestamp: nil) ⇒ AvailabilityResult

Returns a new instance of AvailabilityResult.



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

def initialize(url:, available:, archive_url: nil, timestamp: nil)
  @url = url
  @available = available
  @archive_url = archive_url
  @timestamp = timestamp
end

Instance Attribute Details

#archive_urlObject (readonly)

Returns the value of attribute archive_url.



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

def archive_url
  @archive_url
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



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

def timestamp
  @timestamp
end

#urlObject (readonly)

Returns the value of attribute url.



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

def url
  @url
end

Instance Method Details

#available?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/archaeo/availability_result.rb', line 18

def available?
  @available
end