Sha256: de6b5168e2f6540b20b267c9dfd987eb47725b56cc36e24f6b9df86fce9c998d

Contents?: true

Size: 1.03 KB

Versions: 15

Compression:

Stored size: 1.03 KB

Contents

require 'brazenhead'

module Gametel
  module Platforms
    module Button
      def get_button_by_index(index, &block)
        chain_calls do |device|
          device.get_button index, :variable => '@@the_button@@'
          block.call device if block
        end
      end

      def get_button_by_text(text, &block)
        chain_calls do |device|
          device.get_button text, :variable => '@@the_button@@'
          block.call device if block
        end
      end

      def get_button_property_by_index(index, property)
        get_button_by_index(index) do |device|
          device.send "is_#{property}"
        end
        last_response.body
      end

      def get_button_property_by_id(id, property)
        get_view_by_id(id) do |device|
          device.send "is_#{property}"
        end
        last_response.body
      end

      def get_button_property_by_text(text, property)
        get_button_by_text(text) do |device|
          device.send "is_#{property}"
        end
        last_response.body
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
gametel-0.7 lib/gametel/platforms/brazenhead/button.rb
gametel-0.6 lib/gametel/platforms/brazenhead/button.rb
gametel-0.5.9.3 lib/gametel/platforms/brazenhead/button.rb
gametel-0.5.9.2 lib/gametel/platforms/brazenhead/button.rb
gametel-0.5.9.1 lib/gametel/platforms/brazenhead/button.rb
gametel-0.5.9 lib/gametel/platforms/brazenhead/button.rb
gametel-0.5.8.1 lib/gametel/platforms/brazenhead/button.rb
gametel-0.5.8 lib/gametel/platforms/brazenhead/button.rb
gametel-0.5.7 lib/gametel/platforms/brazenhead/button.rb
gametel-0.5.6 lib/gametel/platforms/brazenhead/button.rb
gametel-0.5.5 lib/gametel/platforms/brazenhead/button.rb
gametel-0.5.4 lib/gametel/platforms/brazenhead/button.rb
gametel-0.5.3 lib/gametel/platforms/brazenhead/button.rb
gametel-0.5.2 lib/gametel/platforms/brazenhead/button.rb
gametel-0.5.1 lib/gametel/platforms/brazenhead/button.rb