Class: Sounder::Sound

Inherits:
Object
  • Object
show all
Defined in:
lib/sounder/sound.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#fileObject (readonly)

Returns the value of attribute file.



5
6
7
# File 'lib/sounder/sound.rb', line 5

def file
  @file
end

Instance Method Details

#playObject



10
11
12
# File 'lib/sounder/sound.rb', line 10

def play
  system %{/usr/bin/afplay "#{@file}" &}
end