Class: Sounder::Sound
- Inherits:
-
Object
- Object
- Sounder::Sound
- Defined in:
- lib/sounder/sound.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
Instance Method Summary collapse
-
#initialize(path) ⇒ Sound
constructor
A new instance of Sound.
- #play ⇒ Object
Constructor Details
#initialize(path) ⇒ Sound
Returns a new instance of Sound.
6 7 8 |
# File 'lib/sounder/sound.rb', line 6 def initialize path @file = Shellwords.escape path end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
5 6 7 |
# File 'lib/sounder/sound.rb', line 5 def file @file end |
Instance Method Details
#play ⇒ Object
10 11 12 |
# File 'lib/sounder/sound.rb', line 10 def play system %{/usr/bin/afplay "#{@file}" &} end |