Module: UniMIDI::Command

Extended by:
Command
Included in:
Command
Defined in:
lib/unimidi/command.rb

Overview

Module for command-line use of UniMIDI. Used by the bin/unimidi script

Instance Method Summary collapse

Instance Method Details

#exec(command, options = {}) ⇒ Boolean

Execute a command

Parameters:

  • command (Symbol)
  • options (Hash) (defaults to: {})

Returns:

  • (Boolean)

12
13
14
15
16
17
18
19
20
21
22
# File 'lib/unimidi/command.rb', line 12

def exec(command, options = {})
  if [:l, :list, :list_devices].include?(command)
    puts "input:"
    Input.list
    puts "output:"
    Output.list
    true
  else
    raise "Command #{command.to_s} not found"
  end   
end