Class: Archaeo::PageBundle

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/archaeo/page_bundle.rb

Overview

A fetched page together with all its extracted asset URLs.

Bundles a Page with the AssetList discovered from its HTML, providing a single object for complete page archival.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(page:, assets:) ⇒ PageBundle

Returns a new instance of PageBundle.



13
14
15
16
# File 'lib/archaeo/page_bundle.rb', line 13

def initialize(page:, assets:)
  @page = page
  @assets = assets
end

Instance Attribute Details

#assetsObject (readonly)

Returns the value of attribute assets.



11
12
13
# File 'lib/archaeo/page_bundle.rb', line 11

def assets
  @assets
end

#pageObject (readonly)

Returns the value of attribute page.



11
12
13
# File 'lib/archaeo/page_bundle.rb', line 11

def page
  @page
end

Instance Method Details

#asset_countObject



26
27
28
# File 'lib/archaeo/page_bundle.rb', line 26

def asset_count
  assets.size
end

#each(&block) ⇒ Object



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

def each(&block)
  assets.each(&block)
end

#sizeObject



22
23
24
# File 'lib/archaeo/page_bundle.rb', line 22

def size
  assets.size + 1
end