Class: Gyruby::Remote::MouseButton

Inherits:
Object
  • Object
show all
Defined in:
lib/gyruby/remote.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ MouseButton

Returns a new instance of MouseButton.



26
27
28
29
30
31
# File 'lib/gyruby/remote.rb', line 26

def initialize(options)
  @event, @block, @frequency = options.delete(:event), options.delete(:block), options.delete(:frequency)
  @last = nil
  @action = :press
  @press = self
end

Instance Attribute Details

#actionObject

Returns the value of attribute action.



25
26
27
# File 'lib/gyruby/remote.rb', line 25

def action
  @action
end

#blockObject

Returns the value of attribute block.



25
26
27
# File 'lib/gyruby/remote.rb', line 25

def block
  @block
end

#eventObject

Returns the value of attribute event.



25
26
27
# File 'lib/gyruby/remote.rb', line 25

def event
  @event
end

#frequencyObject

Returns the value of attribute frequency.



25
26
27
# File 'lib/gyruby/remote.rb', line 25

def frequency
  @frequency
end

#lastObject

Returns the value of attribute last.



25
26
27
# File 'lib/gyruby/remote.rb', line 25

def last
  @last
end

#pressObject

Returns the value of attribute press.



25
26
27
# File 'lib/gyruby/remote.rb', line 25

def press
  @press
end

Instance Method Details

#release(event) ⇒ Object



32
33
34
35
36
37
# File 'lib/gyruby/remote.rb', line 32

def release(event)
  rval = self.clone
  rval.action = :release
  rval.event = event
  return rval
end