Class: ItunesCLI::Player
- Inherits:
-
Object
- Object
- ItunesCLI::Player
- Defined in:
- lib/itunes-cli/player.rb
Instance Attribute Summary collapse
-
#itunes ⇒ Object
readonly
Returns the value of attribute itunes.
Instance Method Summary collapse
- #current ⇒ Object
-
#initialize ⇒ Player
constructor
A new instance of Player.
- #next ⇒ Object
- #pause ⇒ Object
- #play ⇒ Object
- #prev ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize ⇒ Player
Returns a new instance of Player.
7 8 9 |
# File 'lib/itunes-cli/player.rb', line 7 def initialize @itunes = WIN32OLE.new("iTunes.Application") end |
Instance Attribute Details
#itunes ⇒ Object (readonly)
Returns the value of attribute itunes.
5 6 7 |
# File 'lib/itunes-cli/player.rb', line 5 def itunes @itunes end |
Instance Method Details
#current ⇒ Object
31 32 33 |
# File 'lib/itunes-cli/player.rb', line 31 def current Track.new({:title => track, :artist => artist, :album => album}) end |
#next ⇒ Object
27 28 29 |
# File 'lib/itunes-cli/player.rb', line 27 def next @itunes.NextTrack() end |
#pause ⇒ Object
15 16 17 |
# File 'lib/itunes-cli/player.rb', line 15 def pause @itunes.Pause() end |
#play ⇒ Object
11 12 13 |
# File 'lib/itunes-cli/player.rb', line 11 def play @itunes.Play() end |
#prev ⇒ Object
23 24 25 |
# File 'lib/itunes-cli/player.rb', line 23 def prev @itunes.PreviousTrack() end |
#stop ⇒ Object
19 20 21 |
# File 'lib/itunes-cli/player.rb', line 19 def stop @itunes.Stop() end |