Class: Fluent::Platforms::MechanizeDriver::PlatformObject

Inherits:
Object
  • Object
show all
Defined in:
lib/fluent/platform_mechanize/platform_object.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(driver) ⇒ PlatformObject

Returns a new instance of PlatformObject.



8
9
10
# File 'lib/fluent/platform_mechanize/platform_object.rb', line 8

def initialize(driver)
  @driver = driver
end

Instance Attribute Details

#driverObject (readonly)

Returns the value of attribute driver.



6
7
8
# File 'lib/fluent/platform_mechanize/platform_object.rb', line 6

def driver
  @driver
end

Instance Method Details



22
23
24
25
26
27
28
# File 'lib/fluent/platform_mechanize/platform_object.rb', line 22

def get_cookie_value(name)
  for cookie in driver.cookie_jar.cookies 
    if cookie.name == name
      return cookie.value
    end
  end
end

#markupObject



18
19
20
# File 'lib/fluent/platform_mechanize/platform_object.rb', line 18

def markup
  driver.current_page.body
end

#visit(url) ⇒ Object

Browser-Level Actions ##



14
15
16
# File 'lib/fluent/platform_mechanize/platform_object.rb', line 14

def visit(url)
  driver.get(url)
end