Class: Gametel::Views::View

Inherits:
Object
  • Object
show all
Defined in:
lib/gametel/views/view.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(platform, locator) ⇒ View

Returns a new instance of View.



6
7
8
9
10
# File 'lib/gametel/views/view.rb', line 6

def initialize(platform, locator)
  @platform = platform
  @locator = locator
  build_property_methods
end

Instance Attribute Details

#locatorObject (readonly)

Returns the value of attribute locator.



4
5
6
# File 'lib/gametel/views/view.rb', line 4

def locator
  @locator
end

#platformObject (readonly)

Returns the value of attribute platform.



4
5
6
# File 'lib/gametel/views/view.rb', line 4

def platform
  @platform
end

Instance Method Details

#raw_view(&block) ⇒ Object



16
17
18
19
20
21
# File 'lib/gametel/views/view.rb', line 16

def raw_view(&block)
  get_view_by_id(locator[:id], &block) if locator[:id]
  get_view_by_index(view_class, locator[:index], &block) if locator[:index]
  get_view_by_index(locator[:class], locator[:index] || 0, &block) if locator[:class]
  get_view_by_text(locator[:text], &block) if locator[:text]
end

#view_classObject



12
13
14
# File 'lib/gametel/views/view.rb', line 12

def view_class
  'android.view.View'
end