Class: WebratScraper

Inherits:
Webrat::MechanizeSession
  • Object
show all
Includes:
Test::Unit::Assertions, Webrat::Matchers
Defined in:
lib/webrat_scraper.rb

Instance Method Summary collapse

Constructor Details

#initialize(context = nil) ⇒ WebratScraper

Returns a new instance of WebratScraper.



11
12
13
# File 'lib/webrat_scraper.rb', line 11

def initialize(context=nil)
  super(context)
end

Instance Method Details

#user_agentObject



15
16
17
# File 'lib/webrat_scraper.rb', line 15

def user_agent
  @user_agent ||= "webrat-scraper " + mechanize.user_agent
end

#user_agent=(new_user_agent) ⇒ Object



19
20
21
# File 'lib/webrat_scraper.rb', line 19

def user_agent=(new_user_agent)
  @user_agent = mechanize.user_agent = new_user_agent
end