Class: LastFM::Client::CommandLineClient
- Inherits:
-
LastFM::Client
- Object
- LastFM::Client
- LastFM::Client::CommandLineClient
- Defined in:
- lib/lastfm.rb
Instance Attribute Summary
Attributes inherited from LastFM::Client
Instance Method Summary collapse
-
#initialize(lastfm, audio_output) ⇒ CommandLineClient
constructor
A new instance of CommandLineClient.
- #start ⇒ Object
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
#start ⇒ Object
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 |