Class: Describer
- Inherits:
-
Object
- Object
- Describer
- Defined in:
- lib/xcmonkey/describer.rb
Instance Attribute Summary collapse
-
#driver ⇒ Object
Returns the value of attribute driver.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
- #ensure_required_params(params) ⇒ Object
-
#initialize(params) ⇒ Describer
constructor
A new instance of Describer.
- #run ⇒ Object
Constructor Details
Instance Attribute Details
#driver ⇒ Object
Returns the value of attribute driver.
2 3 4 |
# File 'lib/xcmonkey/describer.rb', line 2 def driver @driver end |
#x ⇒ Object
Returns the value of attribute x.
2 3 4 |
# File 'lib/xcmonkey/describer.rb', line 2 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
2 3 4 |
# File 'lib/xcmonkey/describer.rb', line 2 def y @y end |
Instance Method Details
#ensure_required_params(params) ⇒ Object
16 17 18 19 20 |
# File 'lib/xcmonkey/describer.rb', line 16 def ensure_required_params(params) Logger.error('UDID should be provided') if params[:udid].nil? Logger.error('`x` point coordinate should be provided') if params[:x].nil? || params[:x].to_i.to_s != params[:x].to_s Logger.error('`y` point coordinate should be provided') if params[:y].nil? || params[:y].to_i.to_s != params[:y].to_s end |
#run ⇒ Object
11 12 13 14 |
# File 'lib/xcmonkey/describer.rb', line 11 def run driver.ensure_device_exists driver.describe_point(x, y) end |