Class: Sonice::App
- Inherits:
-
Sinatra::Base
- Object
- Sinatra::Base
- Sonice::App
- Defined in:
- lib/sonice/app.rb
Overview
Sinatra application
Instance Method Summary collapse
-
#initialize ⇒ App
constructor
A new instance of App.
- #player ⇒ Object
Constructor Details
#initialize ⇒ App
Returns a new instance of App.
17 18 19 |
# File 'lib/sonice/app.rb', line 17 def initialize @player = player end |
Instance Method Details
#player ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/sonice/app.rb', line 21 def player @player ||= begin puts "Looking for a player..." player = Anyplayer::Selector.new.player abort "Error: no music player launched!" unless player puts "Connected to #{player.name}" player end end |