Class: ICuke::Simulate::Gestures::Tap

Inherits:
Object
  • Object
show all
Defined in:
lib/icuke/simulate.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(x, y, options = {}) ⇒ Tap

Returns a new instance of Tap.



80
81
82
83
84
85
# File 'lib/icuke/simulate.rb', line 80

def initialize(x, y, options = {})
  @options = options
  
  @x = x
  @y = y
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



78
79
80
# File 'lib/icuke/simulate.rb', line 78

def options
  @options
end

#xObject

Returns the value of attribute x.



78
79
80
# File 'lib/icuke/simulate.rb', line 78

def x
  @x
end

#yObject

Returns the value of attribute y.



78
79
80
# File 'lib/icuke/simulate.rb', line 78

def y
  @y
end

Instance Method Details

#to_json(*a) ⇒ Object



87
88
89
90
91
92
# File 'lib/icuke/simulate.rb', line 87

def to_json(*a)
  [
    ICuke::Simulate::Events::Touch.new(:down, [[x, y]], options),
    ICuke::Simulate::Events::Touch.new(:up, [[x, y]])
  ].to_json(*a)
end