Class: Steam::Session

Inherits:
Object
  • Object
show all
Includes:
Locator::Assertions, Locator::Matcher, Test::Unit::Assertions
Defined in:
lib/steam/session.rb,
lib/steam/session/rails.rb

Direct Known Subclasses

Rails

Defined Under Namespace

Classes: Rails

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(browser = nil) ⇒ Session

Returns a new instance of Session.



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

def initialize(browser = nil)
  @browser = browser
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



27
28
29
30
# File 'lib/steam/session.rb', line 27

def method_missing(method, *args, &block)
  return browser.send(method, *args, &block) # if browser.respond_to?(method)
  super
end

Instance Attribute Details

#browserObject

Returns the value of attribute browser.



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

def browser
  @browser
end

Instance Method Details

#respond_to?(method) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/steam/session.rb', line 23

def respond_to?(method)
  browser.respond_to?(method) ? true : super
end

#select(*args, &block) ⇒ Object

because Class implements #select



32
33
34
# File 'lib/steam/session.rb', line 32

def select(*args, &block) # because Class implements #select
  browser.select(*args, &block)
end