Class: WTFChord::PianoKey

Inherits:
InstrumentPitch show all
Defined in:
lib/wtf_chord/piano_key.rb

Instance Attribute Summary

Attributes inherited from InstrumentPitch

#interval, #original

Attributes inherited from Pitch

#note, #octave

Instance Method Summary collapse

Methods inherited from InstrumentPitch

#<=>, #code, #dead, #distance_to, #holded?, #init_pitch, #initialize, #initialize_dup

Methods inherited from Pitch

#-, #-@, #<=>, #==, #chord, #initialize, #move, #to_i, #to_s, #to_str

Constructor Details

This class inherits a constructor from WTFChord::InstrumentPitch

Instance Method Details

#dead?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/wtf_chord/piano_key.rb', line 11

def dead?
  !pressed?
end

#press!Object



15
16
17
# File 'lib/wtf_chord/piano_key.rb', line 15

def press!
  @pressed = true
end

#pressed?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/wtf_chord/piano_key.rb', line 7

def pressed?
  !!@pressed
end