Class: TpbWrap::Page

Inherits:
Object
  • Object
show all
Includes:
FromHash
Defined in:
lib/tpb_wrap/page.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



4
5
6
# File 'lib/tpb_wrap/page.rb', line 4

def body
  @body
end

Instance Method Details

#first_sourceObject



11
12
13
14
# File 'lib/tpb_wrap/page.rb', line 11

def first_source
  link = doc.css("a.detLink").first
  Source.new(:page_url => link.attribute("href"))
end

#url=(url) ⇒ Object



5
6
7
# File 'lib/tpb_wrap/page.rb', line 5

def url=(url)
  self.body = open(url).read
end