Class: StaticGenerator::Page
- Inherits:
-
Object
- Object
- StaticGenerator::Page
- Defined in:
- lib/static_generator.rb
Instance Attribute Summary collapse
-
#crawled_page ⇒ Object
readonly
Returns the value of attribute crawled_page.
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(crawled_page, url_prefix) ⇒ Page
constructor
A new instance of Page.
- #short_path ⇒ Object
Constructor Details
#initialize(crawled_page, url_prefix) ⇒ Page
Returns a new instance of Page.
19 20 21 22 |
# File 'lib/static_generator.rb', line 19 def initialize(crawled_page, url_prefix) @crawled_page = crawled_page # from anemone @url_prefix = url_prefix end |
Instance Attribute Details
#crawled_page ⇒ Object (readonly)
Returns the value of attribute crawled_page.
17 18 19 |
# File 'lib/static_generator.rb', line 17 def crawled_page @crawled_page end |
Instance Method Details
#body ⇒ Object
28 29 30 |
# File 'lib/static_generator.rb', line 28 def body @crawled_page.body end |
#short_path ⇒ Object
24 25 26 |
# File 'lib/static_generator.rb', line 24 def short_path @crawled_page.url.to_s[@url_prefix.length, @crawled_page.url.to_s.length] end |