Class: Mynu::Support::System

Inherits:
Object
  • Object
show all
Defined in:
lib/mynu/support/system.rb

Constant Summary collapse

CommandDown =
SystemEventsEMdsCommandDown
ControlDown =
SystemEventsEMdsControlDown
OptionDown =
SystemEventsEMdsOptionDown
ShiftDown =
SystemEventsEMdsShiftDown

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSystem

Returns a new instance of System.



13
14
15
# File 'lib/mynu/support/system.rb', line 13

def initialize
  self.system = SBApplication.applicationWithBundleIdentifier("com.apple.SystemEvents")
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



22
23
24
# File 'lib/mynu/support/system.rb', line 22

def method_missing(method, *args)
  args.empty? ? @system.send(method) : @system.send(method, args)
end

Instance Attribute Details

#systemObject

Returns the value of attribute system.



6
7
8
# File 'lib/mynu/support/system.rb', line 6

def system
  @system
end

Instance Method Details

#keystroke(keys, using = 0) ⇒ Object

wrapping a native selector



18
19
20
# File 'lib/mynu/support/system.rb', line 18

def keystroke(keys, using=0)
  @system.send(:"keystroke:using:", keys, using)
end