Skip to content

Commit

Permalink
refactor Spinner to use base class
Browse files Browse the repository at this point in the history
  • Loading branch information
leviwilson committed Jul 9, 2013
1 parent 3e9855a commit 87f86a1
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions lib/gametel/views/spinner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,9 @@ module Gametel
module Views
class Spinner < View

SPINNER_CLASS = 'android.widget.Spinner'

protected

def build_property_methods
metaclass = class << self; self; end
properties.each do |property|
metaclass.send(:define_method, "#{property}?".to_sym) do

platform.get_view_by_id(locator[:id]) do |device|
device.send "is_#{property}"
end if locator[:id]

platform.get_view_by_index(SPINNER_CLASS, locator[:index]) do |device|
device.send "is_#{property}"
end if locator[:index]

platform.last_response.body == "true"
end
end
def view_class
'android.widget.Spinner'
end


end
end
Expand Down

0 comments on commit 87f86a1

Please sign in to comment.