Class: StaticGenerator::Page

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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_pageObject (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

#bodyObject



28
29
30
# File 'lib/static_generator.rb', line 28

def body
  @crawled_page.body
end

#short_pathObject



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