Class: ATT::RegFactory

Inherits:
WindowFactory show all
Defined in:
lib/popup/window_factory.rb

Class Method Summary collapse

Methods inherited from WindowFactory

_config, _make_other, config, make_other

Class Method Details

.make(klass) ⇒ Object



34
35
36
# File 'lib/popup/window_factory.rb', line 34

def make(klass)
  RAutomation::Window.new(:title=> reg_title(klass), :adapter=>"autoit" )
end

.reg(hash_or_array) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/popup/window_factory.rb', line 42

def reg(hash_or_array)
  if hash_or_array.kind_of?(Array)
    ach = "each"
  else
    ach = "each_value"
  end
  reg_str = ""
  hash_or_array.send(ach) do |v|
    next if v == ""
    reg_str += ( Regexp.escape(v) + "|" )
  end
  Regexp.new(reg_str.chop)
end

.reg_title(klass) ⇒ Object



38
39
40
# File 'lib/popup/window_factory.rb', line 38

def reg_title(klass)
  reg(config(klass)["title"])
end