Class: LastFM::Client::CommandLineClient

Inherits:
LastFM::Client show all
Defined in:
lib/lastfm.rb

Instance Attribute Summary

Attributes inherited from LastFM::Client

#current_song

Instance Method Summary collapse

Methods inherited from LastFM::Client

#display_current_song, #divider, #flush_output_buffer, #help, #parse_command, #play, #prompt, #skip, #stop, #tune

Constructor Details

#initialize(lastfm, audio_output) ⇒ CommandLineClient

Returns a new instance of CommandLineClient.



325
326
327
# File 'lib/lastfm.rb', line 325

def initialize(lastfm, audio_output)
  super
end

Instance Method Details

#startObject



328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
# File 'lib/lastfm.rb', line 328

def start
  puts
  #puts "starting command line lastfm client"
  print prompt
  $stdout.flush
  while req = gets
    req = req.split(" ")
    puts 
    command = req.shift
    parse_command(command, req)
    print flush_output_buffer
    unless command =~ /^h/
      puts "\n" 
      print prompt 
    end
    $stdout.flush
  end
  #puts "command line session ended"
end