Class: Airplay::Group::Players
- Inherits:
-
Object
- Object
- Airplay::Group::Players
- Defined in:
- lib/airplay/group/players.rb
Instance Attribute Summary collapse
-
#players ⇒ Object
readonly
Returns the value of attribute players.
Instance Method Summary collapse
-
#initialize(players) ⇒ Players
constructor
A new instance of Players.
- #progress(callback) ⇒ Object
- #wait ⇒ Object
Constructor Details
#initialize(players) ⇒ Players
Returns a new instance of Players.
6 7 8 |
# File 'lib/airplay/group/players.rb', line 6 def initialize(players) @players = players end |
Instance Attribute Details
#players ⇒ Object (readonly)
Returns the value of attribute players.
4 5 6 |
# File 'lib/airplay/group/players.rb', line 4 def players @players end |
Instance Method Details
#progress(callback) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/airplay/group/players.rb', line 10 def progress(callback) players.each do |player| player.progress -> info { callback.call(player.device, info) if player. } end end |
#wait ⇒ Object
18 19 20 21 |
# File 'lib/airplay/group/players.rb', line 18 def wait sleep 0.1 while players.map(&:cleanup) end |