Class: MusicBlender::Shell

Inherits:
Object
  • Object
show all
Defined in:
lib/music_blender/shell.rb

Constant Summary collapse

COMMANDS =
{
  exit: ->() { player.stop; player.quit; throw(:exited, 'Exited Successfully'); },
  info: ->() { print_info },
  pause: ->() { player.pause },
  play: ->() { player.play },
  quit: ->() { player.quit },
  rate: ->(rating) { update_rating(rating) },
  stop: ->() { player.stop },
}.with_indifferent_access

Instance Method Summary collapse

Instance Method Details

#runObject



14
15
16
17
18
19
# File 'lib/music_blender/shell.rb', line 14

def run
  loop do
    print 'mmp> '
    execute(*next_command_with_args)
  end
end