Class: Steam::Session::Rails

Inherits:
Steam::Session show all
Includes:
ActionController
Defined in:
lib/steam/session/rails.rb

Instance Attribute Summary

Attributes inherited from Steam::Session

#browser

Instance Method Summary collapse

Methods inherited from Steam::Session

#method_missing, #respond_to?, #select

Constructor Details

#initialize(browser = nil) ⇒ Rails

Returns a new instance of Rails.



6
7
8
9
10
11
12
13
# File 'lib/steam/session/rails.rb', line 6

def initialize(browser = nil)
  super

  # install the named routes in this session instance.
  klass = class << self; self; end
  ActionController::Routing::Routes.install_helpers(klass)
  klass.module_eval { public *Routing::Routes.named_routes.helpers }
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Steam::Session

Instance Method Details

#controllerObject

FIXME we only have access to the controller when Steam can run HtmlUnit and the app in one stack



17
18
# File 'lib/steam/session/rails.rb', line 17

def controller
end

#url_for(options) ⇒ Object



20
21
22
# File 'lib/steam/session/rails.rb', line 20

def url_for(options) 
  controller ? controller.url_for(options) : generic_url_rewriter.rewrite(options)
end