Class: Mynu::Support::System
- Inherits:
-
Object
- Object
- Mynu::Support::System
- Defined in:
- lib/mynu/support/system.rb
Constant Summary collapse
- CommandDown =
SystemEventsEMdsCommandDown- ControlDown =
SystemEventsEMdsControlDown- OptionDown =
SystemEventsEMdsOptionDown- ShiftDown =
SystemEventsEMdsShiftDown
Instance Attribute Summary collapse
-
#system ⇒ Object
Returns the value of attribute system.
Instance Method Summary collapse
-
#initialize ⇒ System
constructor
A new instance of System.
-
#keystroke(keys, using = 0) ⇒ Object
wrapping a native selector.
- #method_missing(method, *args) ⇒ Object
Constructor Details
#initialize ⇒ System
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
#system ⇒ Object
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 |