Module: Vapir::Label

Extended by:
ElementHelper
Defined in:
lib/vapir-common/elements/elements.rb

Instance Method Summary collapse

Methods included from ElementHelper

add_specifier, container_collection_method, container_single_method, included

Methods included from ElementClassAndModuleMethods

#add_container_method_extra_args, #all_dom_attr_aliases, #all_dom_attrs, #class_array_append, #class_array_get, #class_hash_get, #class_hash_merge, #container_collection_methods, #container_method_extra_args, #container_single_methods, #default_how, #dom_attr, #dom_attr_locate_alias, #dom_function, #dom_setter, #element_collection, #factory, #inspect_these, #inspect_this_if, #parent_element_module, #set_or_get_class_var, #specifiers

Instance Method Details

#for_elementObject



937
938
939
940
941
942
943
944
# File 'lib/vapir-common/elements/elements.rb', line 937

def for_element
  raise "document is not defined - cannot search for labeled element" unless document_object
  if for_object=document_object.getElementById(element_object.htmlFor)
    base_element_class.factory(for_object, container.extra_for_contained, :label, self)
  else
    raise Exception::UnknownObjectException, "no element found that #{self.inspect} is for!"
  end
end