Class: Macaron::Page
- Inherits:
-
Object
- Object
- Macaron::Page
- Defined in:
- lib/macaron/page.rb
Instance Method Summary collapse
- #fetch ⇒ Object
-
#initialize(url, bot = nil) ⇒ Page
constructor
A new instance of Page.
- #inner_links ⇒ Object
- #title ⇒ Object
Constructor Details
#initialize(url, bot = nil) ⇒ Page
Returns a new instance of Page.
6 7 8 9 |
# File 'lib/macaron/page.rb', line 6 def initialize(url, bot=nil) @url = url @bot = bot end |
Instance Method Details
#fetch ⇒ Object
11 12 13 14 15 |
# File 'lib/macaron/page.rb', line 11 def fetch document base(@url) self end |
#inner_links ⇒ Object
17 18 19 20 21 |
# File 'lib/macaron/page.rb', line 17 def inner_links anchors = links.select {|link| URI.parse(link).host == @base.host }.compact end |
#title ⇒ Object
23 24 25 |
# File 'lib/macaron/page.rb', line 23 def title @doc.title end |