Class: Commands::Type

Inherits:
Object
  • Object
show all
Defined in:
lib/commands/type.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args, settings) ⇒ Type

Returns a new instance of Type.



3
4
5
# File 'lib/commands/type.rb', line 3

def initialize(args, settings)
  @keys = args.join(' ')
end

Class Method Details

.matchesObject



19
20
21
# File 'lib/commands/type.rb', line 19

def self.matches
  ['type']
end

Instance Method Details

#goObject



7
8
9
# File 'lib/commands/type.rb', line 7

def go
  `osascript -e 'tell application "System Events" to keystroke "#{@keys}"'`
end

#media?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/commands/type.rb', line 15

def media?
  false
end

#respondObject



11
12
13
# File 'lib/commands/type.rb', line 11

def respond
  "Your string has been typed!"
end