Sha256: 3435085a714e79c0bb7febdf42e48e2f5c963c19b3ca00a6ebb4f9f943654330

Contents?: true

Size: 561 Bytes

Versions: 1

Compression:

Stored size: 561 Bytes

Contents

module PageObject
  module Elements
    class Audio < Element

      def autoplay?
        attribute(:autoplay)
      end

      def has_controls?
        attribute(:controls)
      end

      def paused?
        attribute(:paused)
      end

      def duration
        duration = attribute(:duration)
        return duration.to_f if duration
      end

      def volume
        volume = attribute(:volume)
        return volume.to_i if volume
      end
      
    end
    ::PageObject::Elements.type_to_class[:audio] = ::PageObject::Elements::Audio
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
page-object-0.7.2 lib/page-object/elements/audio.rb