Class: Archaeo::PageBundle
- Inherits:
-
Object
- Object
- Archaeo::PageBundle
- 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
-
#assets ⇒ Object
readonly
Returns the value of attribute assets.
-
#page ⇒ Object
readonly
Returns the value of attribute page.
Instance Method Summary collapse
- #asset_count ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(page:, assets:) ⇒ PageBundle
constructor
A new instance of PageBundle.
- #size ⇒ Object
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
#assets ⇒ Object (readonly)
Returns the value of attribute assets.
11 12 13 |
# File 'lib/archaeo/page_bundle.rb', line 11 def assets @assets end |
#page ⇒ Object (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_count ⇒ Object
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 |
#size ⇒ Object
22 23 24 |
# File 'lib/archaeo/page_bundle.rb', line 22 def size assets.size + 1 end |