Class: Text

Inherits:
BaseElement show all
Defined in:
lib/rutl/interface/elements/text.rb

Overview

I’m using the text element for all text-like things. Passowrds, too.

Instance Attribute Summary

Attributes inherited from BaseElement

#destinations, #interface, #selectors

Instance Method Summary collapse

Methods inherited from BaseElement

#driver, #find_css, #this_css

Constructor Details

#initialize(selectors = {}, destinations = []) ⇒ Text

Returns a new instance of Text.



7
8
9
# File 'lib/rutl/interface/elements/text.rb', line 7

def initialize(selectors = {}, destinations = [])
  super
end

Instance Method Details

#clearObject



11
12
13
# File 'lib/rutl/interface/elements/text.rb', line 11

def clear
  this_css.clear
end

#getObject



19
20
21
# File 'lib/rutl/interface/elements/text.rb', line 19

def get
  this_css.attribute(:value)
end

#set(string) ⇒ Object



27
28
29
# File 'lib/rutl/interface/elements/text.rb', line 27

def set(string)
  this_css.send_keys(string)
end

#textObject



15
16
17
# File 'lib/rutl/interface/elements/text.rb', line 15

def text
  get
end

#text=(string) ⇒ Object



23
24
25
# File 'lib/rutl/interface/elements/text.rb', line 23

def text=(string)
  set(string)
end