123456789_123456789_123456789_123456789_123456789_

Class: Selenium::WebDriver::VirtualAuthenticator

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

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(bridge, authenticator_id, options) ⇒ VirtualAuthenticator

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator.rb', line 30

def initialize(bridge, authenticator_id, options)
  @id = authenticator_id
  @bridge = bridge
  @options = options
  @valid = true
end

Instance Attribute Details

#options (readonly)

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator.rb', line 23

attr_reader :options

#user_verified=(verified) (writeonly)

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator.rb', line 58

def user_verified=(verified)
  @bridge.user_verified verified, @id
end

#valid?Boolean (readonly)

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator.rb', line 67

def valid?
  @valid
end

Instance Method Details

#add_credential(credential)

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator.rb', line 37

def add_credential(credential)
  credential = credential.as_json
  @bridge.add_credential credential, @id
end

#credentials

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator.rb', line 42

def credentials
  credential_data = @bridge.credentials @id
  credential_data.map do |cred|
    Credential.from_json(cred)
  end
end

#remove!

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator.rb', line 62

def remove!
  @bridge.remove_virtual_authenticator(@id)
  @valid = false
end

#remove_all_credentials

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator.rb', line 54

def remove_all_credentials
  @bridge.remove_all_credentials @id
end

#remove_credential(credential_id)

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator.rb', line 49

def remove_credential(credential_id)
  credential_id = Credential.encode(credential_id) if credential_id.instance_of?(Array)
  @bridge.remove_credential credential_id, @id
end