class Selenium::WebDriver::Interactions::KeyInput::TypingInteraction

Attributes

type[R]

Public Class Methods

new(source, type, key) click to toggle source
# File lib/selenium/webdriver/common/interactions/key_input.rb, line 47
def initialize(source, type, key)
  super(source)
  @type = assert_type(type)
  @key = Keys.encode_key(key)
end

Public Instance Methods

assert_type(type) click to toggle source
# File lib/selenium/webdriver/common/interactions/key_input.rb, line 53
def assert_type(type)
  raise TypeError, "#{type.inspect} is not a valid key subtype" unless KeyInput::SUBTYPES.key? type

  KeyInput::SUBTYPES[type]
end
encode() click to toggle source
# File lib/selenium/webdriver/common/interactions/key_input.rb, line 59
def encode
  {type: @type, value: @key}
end