Sha256: 1f6aa2980e746ead9644697e0416dbb3510a1b3bc788d944592974f0e629ce16

Contents?: true

Size: 766 Bytes

Versions: 12

Compression:

Stored size: 766 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.getAttributeValue('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

12 entries across 12 versions & 2 rubygems

Version Path
jarib-celerity-0.0.5.10 lib/celerity/elements/link.rb
jarib-celerity-0.0.5.11 lib/celerity/elements/link.rb
jarib-celerity-0.0.5.7 lib/celerity/elements/link.rb
jarib-celerity-0.0.5.8 lib/celerity/elements/link.rb
jarib-celerity-0.0.5.9 lib/celerity/elements/link.rb
jarib-celerity-0.0.6.1 lib/celerity/elements/link.rb
jarib-celerity-0.0.6.2 lib/celerity/elements/link.rb
jarib-celerity-0.0.6.3 lib/celerity/elements/link.rb
jarib-celerity-0.0.6.4 lib/celerity/elements/link.rb
jarib-celerity-0.0.6.5 lib/celerity/elements/link.rb
jarib-celerity-0.0.6 lib/celerity/elements/link.rb
celerity-0.0.6 lib/celerity/elements/link.rb