Sha256: 1761e2ad44af7adeb296c7aff9ea610e548988c7b016e69e13b3efd79074afd2

Contents?: true

Size: 557 Bytes

Versions: 9

Compression:

Stored size: 557 Bytes

Contents

module Celerity

  #
  # Represents an option in a select list.
  #

  class Option < Element
    include ClickableElement
    include DisabledElement

    TAGS = [ Identifier.new('option')]
    ATTRIBUTES = BASE_ATTRIBUTES | [:selected, :disabled, :label, :value]
    DEFAULT_HOW = :text

    alias_method :select, :click

    #
    # Is this option selected?
    #

    def selected?
      assert_exists
      @object.isSelected
    end

    def label
      # overrides Container#label
      assert_exists
      @object.getLabelAttribute
    end
  end
end

Version data entries

9 entries across 9 versions & 3 rubygems

Version Path
caius-celerity-0.0.6.10 lib/celerity/elements/option.rb
caius-celerity-0.0.6.11 lib/celerity/elements/option.rb
jarib-celerity-0.0.6.10 lib/celerity/elements/option.rb
jarib-celerity-0.0.6.11 lib/celerity/elements/option.rb
jarib-celerity-0.0.6.8 lib/celerity/elements/option.rb
jarib-celerity-0.0.6.9 lib/celerity/elements/option.rb
walidhalabi-celerity-0.0.6.11 lib/celerity/elements/option.rb
walidhalabi-celerity-0.0.6.12 lib/celerity/elements/option.rb
walidhalabi-celerity-0.0.6.13 lib/celerity/elements/option.rb