Class: Metallize

Inherits:
Object
  • Object
show all
Defined in:
lib/metallize.rb,
lib/metallize/version.rb

Defined Under Namespace

Modules: ElementMatcher Classes: Form, Page

Constant Summary collapse

VERSION =
"0.0.1"

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(browser) ⇒ Metallize

Returns a new instance of Metallize.



25
26
27
# File 'lib/metallize.rb', line 25

def initialize(browser)
  @driver = Selenium::WebDriver.for browser
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(sym) ⇒ Object



40
41
42
# File 'lib/metallize.rb', line 40

def method_missing(sym)
  driver.send sym
end

Instance Attribute Details

#driverObject (readonly)

Returns the value of attribute driver.



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

def driver
  @driver
end

Class Method Details

.inspectObject



44
45
46
# File 'lib/metallize.rb', line 44

def self.inspect
  'Metallize; Mechanize API using Selenium-WebDriver'
end

Instance Method Details

#get(uri) ⇒ Object



29
30
31
32
# File 'lib/metallize.rb', line 29

def get(uri)
  driver.get(uri)
  Page.new(driver)
end

#quitObject Also known as: close



34
35
36
# File 'lib/metallize.rb', line 34

def quit
  driver.quit
end