123456789_123456789_123456789_123456789_123456789_

Class: Selenium::WebDriver::Manager

Relationships & Source Files
Inherits: Object
Defined in: rb/lib/selenium/webdriver/common/manager.rb

Constant Summary

Class Method Summary

Instance Method Summary

Constructor Details

.new(bridge) ⇒ Manager

This method is for internal use only.
[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/manager.rb', line 27

def initialize(bridge)
  @bridge = bridge
end

Instance Method Details

#all_cookiesArray<Hash>

Get all cookies

Returns:

  • (Array<Hash>)

    list of cookies

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/manager.rb', line 99

def all_cookies
  @bridge.cookies.map { |cookie| convert_cookie(cookie) }
end

#datetime_at(int) (private)

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/manager.rb', line 115

def datetime_at(int)
  DateTime.civil(1970) + (int / SECONDS_PER_DAY)
end

#delete_all_cookies

Delete all cookies

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/manager.rb', line 89

def delete_all_cookies
  @bridge.delete_all_cookies
end

#seconds_from(obj) (private)

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/manager.rb', line 119

def seconds_from(obj)
  case obj
  when Time
    obj.to_f
  when DateTime
    (obj - DateTime.civil(1970)) * SECONDS_PER_DAY
  when Numeric
    obj
  else
    raise ArgumentError, "invalid value for expiration date: #{obj.inspect}"
  end
end

#strip_port(str) (private)

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/manager.rb', line 132

def strip_port(str)
  str.split(':', 2).first
end

#timeouts

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/manager.rb', line 103

def timeouts
  @timeouts ||= Timeouts.new(@bridge)
end

#window

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/manager.rb', line 107

def window
  @window ||= Window.new(@bridge)
end