Class: Mac::EventMonitor::MouseEvent

Inherits:
Event
  • Object
show all
Defined in:
lib/mac-event-monitor/event/mouse_event.rb

Instance Attribute Summary collapse

Attributes inherited from Event

#location, #time, #type

Instance Method Summary collapse

Methods inherited from Event

create_from_description, parse_location

Methods included from JsonSerializable

included, #to_json

Constructor Details

#initialize(type, time, location, button) ⇒ MouseEvent

Returns a new instance of MouseEvent.



6
7
8
9
10
# File 'lib/mac-event-monitor/event/mouse_event.rb', line 6

def initialize(type, time, location, button)
  super(type, time, location)

  @button = button && button.to_sym
end

Instance Attribute Details

#buttonObject (readonly)

Returns the value of attribute button.



4
5
6
# File 'lib/mac-event-monitor/event/mouse_event.rb', line 4

def button
  @button
end

Instance Method Details

#dataObject



12
13
14
# File 'lib/mac-event-monitor/event/mouse_event.rb', line 12

def data
  super + [button]
end