Class: Walkon::EntranceMusic
- Inherits:
-
Object
- Object
- Walkon::EntranceMusic
- Defined in:
- lib/walkon/entrance_music.rb
Instance Attribute Summary collapse
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
Instance Method Summary collapse
- #exists? ⇒ Boolean (also: #present?)
-
#initialize(with_file_name) ⇒ EntranceMusic
constructor
A new instance of EntranceMusic.
- #play ⇒ Object
- #play_track ⇒ Object
- #prefix ⇒ Object
Constructor Details
#initialize(with_file_name) ⇒ EntranceMusic
Returns a new instance of EntranceMusic.
7 8 9 |
# File 'lib/walkon/entrance_music.rb', line 7 def initialize with_file_name @filename = "#{prefix}/#{with_file_name}.mp3" end |
Instance Attribute Details
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
5 6 7 |
# File 'lib/walkon/entrance_music.rb', line 5 def filename @filename end |
Instance Method Details
#exists? ⇒ Boolean Also known as: present?
11 12 13 |
# File 'lib/walkon/entrance_music.rb', line 11 def exists? File.exists? filename end |
#play ⇒ Object
17 18 19 |
# File 'lib/walkon/entrance_music.rb', line 17 def play present? and play_track end |
#play_track ⇒ Object
21 22 23 |
# File 'lib/walkon/entrance_music.rb', line 21 def play_track `xmms #{filename}` == '' end |