Class: Metronome::Beat
- Inherits:
-
Object
- Object
- Metronome::Beat
- Defined in:
- lib/metronome-odd.rb
Instance Attribute Summary collapse
-
#silence ⇒ Object
Returns the value of attribute silence.
Instance Method Summary collapse
-
#initialize(tempo, sound_file) ⇒ Beat
constructor
A new instance of Beat.
- #play ⇒ Object
Constructor Details
#initialize(tempo, sound_file) ⇒ Beat
Returns a new instance of Beat.
59 60 61 62 63 |
# File 'lib/metronome-odd.rb', line 59 def initialize(tempo, sound_file) @sound = Sound.new(sound_file) @silence = Silence.new(60.0/tempo) self end |
Instance Attribute Details
#silence ⇒ Object
Returns the value of attribute silence.
58 59 60 |
# File 'lib/metronome-odd.rb', line 58 def silence @silence end |
Instance Method Details
#play ⇒ Object
65 66 67 68 |
# File 'lib/metronome-odd.rb', line 65 def play @sound.play @silence.wait end |