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.
7 8 9 10 11 |
# File 'lib/macaron/page.rb', line 7 def initialize(url, bot=nil) @url = url @bot = bot @@bot_lock = Mutex.new end |
Instance Method Details
#fetch ⇒ Object
13 14 15 16 17 |
# File 'lib/macaron/page.rb', line 13 def fetch document base(@url) self end |
#inner_links ⇒ Object
19 20 21 22 23 |
# File 'lib/macaron/page.rb', line 19 def inner_links anchors = links.select {|link| URI.parse(link).host == @base.host }.compact end |
#title ⇒ Object
25 26 27 |
# File 'lib/macaron/page.rb', line 25 def title @doc.title end |