Module: Symbiont::DataSetter
- Defined in:
- lib/symbiont/data_setter.rb
Instance Method Summary collapse
- #use_data_with(key, value) ⇒ Object
- #using(data) ⇒ Object (also: #using_data, #use_data, #using_values, #use_values)
Instance Method Details
#use_data_with(key, value) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/symbiont/data_setter.rb', line 15 def use_data_with(key, value) element = self.send("#{key}") self.call_method_chain("#{key}.set", value) if element.class == Watir::TextField self.call_method_chain("#{key}.set") if element.class == Watir::Radio self.call_method_chain("#{key}.select", value) if element.class == Watir::Select return self.call_method_chain("#{key}.check") if element.class == Watir::CheckBox and value return self.call_method_chain("#{key}.uncheck") if element.class == Watir::CheckBox end |
#using(data) ⇒ Object Also known as: using_data, use_data, using_values, use_values
4 5 6 7 8 |
# File 'lib/symbiont/data_setter.rb', line 4 def using(data) data.each do |key, value| use_data_with(key, value) if object_enabled_for(key) end end |