Class: ObjectRepository::WatirElement

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

#==, #initialize, #inspect

Constructor Details

This class inherits a constructor from ObjectRepository::RepositoryElement

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth_name, *args, &block) ⇒ Object



27
28
29
# File 'lib/watir-or/element.rb', line 27

def method_missing(meth_name, *args, &block)
  @locate_block.call(@repository).send(meth_name, *args, &block)
end

Instance Method Details

#locate(&block) ⇒ Object



21
22
23
24
25
# File 'lib/watir-or/element.rb', line 21

def locate(&block)
  if block_given?
    @locate_block = block
  end
end

#present?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/watir-or/element.rb', line 31

def present?
  method_missing(:present?)
end