Class: Selenium::WebDriver::VirtualAuthenticator
- Inherits:
-
Object
- Object
- Selenium::WebDriver::VirtualAuthenticator
- Defined in:
- rb/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #add_credential(credential) ⇒ Object
- #credentials ⇒ Object
-
#initialize(bridge, authenticator_id, options) ⇒ VirtualAuthenticator
constructor
api private Use ‘Driver#add_virtual_authenticator`.
- #remove! ⇒ Object
- #remove_all_credentials ⇒ Object
- #remove_credential(credential_id) ⇒ Object
- #user_verified=(verified) ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(bridge, authenticator_id, options) ⇒ VirtualAuthenticator
api private Use ‘Driver#add_virtual_authenticator`
30 31 32 33 34 35 |
# File 'rb/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator.rb', line 30 def initialize(bridge, authenticator_id, ) @id = authenticator_id @bridge = bridge @options = @valid = true end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
23 24 25 |
# File 'rb/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator.rb', line 23 def @options end |
Instance Method Details
#add_credential(credential) ⇒ Object
37 38 39 40 |
# 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 ⇒ Object
42 43 44 45 46 47 |
# 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! ⇒ Object
62 63 64 65 |
# 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 ⇒ Object
54 55 56 |
# 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) ⇒ Object
49 50 51 52 |
# 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 |
#user_verified=(verified) ⇒ Object
58 59 60 |
# 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
67 68 69 |
# File 'rb/lib/selenium/webdriver/common/virtual_authenticator/virtual_authenticator.rb', line 67 def valid? @valid end |