Class: WebViewer::ElementValueWriter

Inherits:
Object
  • Object
show all
Defined in:
lib/element_value_writer.rb

Overview

ElementValueWriter assigns a value to a Selenium::WebDriver::Element. It uses the element_type parameter passed in the constructor to determine how to write to the element.

Instance Method Summary collapse

Constructor Details

#initialize(web_element, element_type) ⇒ ElementValueWriter

Returns a new instance of ElementValueWriter.



7
8
9
10
# File 'lib/element_value_writer.rb', line 7

def initialize(web_element, element_type)
  @web_element = web_element
  @element_type = element_type
end

Instance Method Details

#value=(new_value) ⇒ Object



12
13
14
15
# File 'lib/element_value_writer.rb', line 12

def value=(new_value)
  # do smart things with element_type in here
  @web_element.value = new_value
end