Class: ObjectRepository::CustomElement

Inherits:
RepositoryElement show all
Defined in:
lib/watir-or/element.rb

Instance Attribute Summary

Attributes inherited from RepositoryElement

#name

Instance Method Summary collapse

Methods inherited from RepositoryElement

#==, #inspect

Constructor Details

#initialize(*args) ⇒ CustomElement

Returns a new instance of CustomElement.



37
38
39
40
# File 'lib/watir-or/element.rb', line 37

def initialize(*args)
  @attributes = {}
  super(*args)
end

Instance Method Details

#field(name, field_name = nil, &block) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/watir-or/element.rb', line 42

def field(name, field_name = nil, &block)
  if block_given?
    @attributes[name] = block
    return
  end

  if field_name 
    @attributes[name] = field_name 
  else
    get_field(name)
  end
end