Class: WebratScraper
- Inherits:
-
Webrat::MechanizeSession
- Object
- Webrat::MechanizeSession
- WebratScraper
- Includes:
- Test::Unit::Assertions, Webrat::Matchers
- Defined in:
- lib/webrat_scraper.rb
Instance Method Summary collapse
-
#initialize(context = nil) ⇒ WebratScraper
constructor
A new instance of WebratScraper.
- #user_agent ⇒ Object
- #user_agent=(new_user_agent) ⇒ Object
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_agent ⇒ Object
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 |