Sha256: cffbb6cd321a7467b6a017fbf8aae06f2b7e576763bf0b994468a969f5c7ea9a

Contents?: true

Size: 761 Bytes

Versions: 2

Compression:

Stored size: 761 Bytes

Contents

module Celerity
  class Link < Element
    include ClickableElement

    TAGS = [ Identifier.new('a') ]
    ATTRIBUTES = BASE_ATTRIBUTES | [:charset, :type, :name, :href, :hreflang,
                                    :target, :rel, :rev, :accesskey, :shape,
                                    :coords, :tabindex, :onfocus, :onblur]
    DEFAULT_HOW = :href
    
    #
    # Returns the absolute URL for this link (Celerity-specific)
    # 
    # (Watir/IE does this for href(), but we don't want that.)
    # 

    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

    
  end # Link
end # Celerity

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jarib-celerity-0.0.6.6 lib/celerity/elements/link.rb
jarib-celerity-0.0.6.7 lib/celerity/elements/link.rb