Class: Selenium::WebDriver::Interactions::KeyInput::TypingInteraction
- Inherits:
-
Interaction
- Object
- Interaction
- Selenium::WebDriver::Interactions::KeyInput::TypingInteraction
- Defined in:
- lib/selenium/webdriver/common/interactions/key_input.rb
Constant Summary
Constants inherited from Interaction
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Attributes inherited from Interaction
Instance Method Summary collapse
- #assert_type(type) ⇒ Object
- #encode ⇒ Object
-
#initialize(source, type, key) ⇒ TypingInteraction
constructor
A new instance of TypingInteraction.
Constructor Details
#initialize(source, type, key) ⇒ TypingInteraction
Returns a new instance of TypingInteraction.
44 45 46 47 48 |
# File 'lib/selenium/webdriver/common/interactions/key_input.rb', line 44 def initialize(source, type, key) super(source) @type = assert_type(type) @key = Keys.encode_key(key) end |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
42 43 44 |
# File 'lib/selenium/webdriver/common/interactions/key_input.rb', line 42 def type @type end |
Instance Method Details
#assert_type(type) ⇒ Object
50 51 52 53 |
# File 'lib/selenium/webdriver/common/interactions/key_input.rb', line 50 def assert_type(type) raise TypeError, "#{type.inspect} is not a valid key subtype" unless KeyInput::SUBTYPES.key? type KeyInput::SUBTYPES[type] end |
#encode ⇒ Object
55 56 57 |
# File 'lib/selenium/webdriver/common/interactions/key_input.rb', line 55 def encode {type: @type, value: @key} end |