Class: Celerity::Link
- Celerity::Element
- Celerity::Link
Included Modules
Constants
- ATTRIBUTES
- BASE_ATTRIBUTES | [:charset, :type, :name, :href, :hreflang, :target, :rel, :rev, :accesskey, :shape, :coords, :tabindex, :onfocus, :onblur]
- DEFAULT_HOW
- :href
- TAGS
- [ Identifier.new('a') ]
Constants Inherited from Celerity::Element
BASE_ATTRIBUTES, CELLHALIGN_ATTRIBUTES, CELLVALIGN_ATTRIBUTES, HTML_401_TRANSITIONAL, TO_S_SIZE
Constructor Summary
This class inherits a constructor from Celerity::Element.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Celerity::Element
Dynamically get element attributes.
[View source]
235 236 237 238 239 240 241 242 243 244 245 |
# File 'lib/celerity/element.rb', line 235 def method_missing(meth, *args, &blk) assert_exists meth = selector_to_attribute(meth) if self.class::ATTRIBUTES.include?(meth) || (self.class == Element && @object.hasAttribute(meth.to_s)) return @object.getAttribute(meth.to_s) end Log.warn "Element\#method_missing calling super with #{meth.inspect}" super end |
Public Visibility
Public Instance Method Summary
#absolute_url |
Returns the absolute URL for this link (Celerity-specific). |
---|
Public Instance Methods Inherited from Celerity::Element
assert_exists, attribute_string, attribute_value, exists?, fire_event, focus, locate, methods, object, parent, respond_to?, text, to_s, to_xml, visible?, xpath
Public Instance Methods Included from Celerity::ClickableElement
click, click_and_attach, double_click, download, right_click
Public Instance Method Details
absolute_url
public
absolute_url
Returns the absolute URL for this link (Celerity-specific)
(Watir/IE does this for href(), but we don’t want that.)
[View source]
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/celerity/elements/link.rb', line 17 def absolute_url assert_exists href = @object.getAttribute('href') unless href.empty? || URI.parse(href).absolute? href = URI.join(browser.url, href).to_s end href end |