lib/music-transcription/model/link.rb in music-transcription-0.15.0 vs lib/music-transcription/model/link.rb in music-transcription-0.16.0

- old
+ new

@@ -28,15 +28,14 @@ def to_s; "="; end end class TargetedLink < Link - attr_accessor :target_pitch, :link_char + attr_accessor :target_pitch - def initialize target_pitch, link_char + def initialize target_pitch @target_pitch = target_pitch - @link_char = link_char end def ==(other) self.class == other.class && @target_pitch == other.target_pitch end @@ -45,30 +44,31 @@ self.clone.transpose! diff end def transpose! diff @target_pitch = @target_pitch.transpose(diff) + return self end def to_s - @link_char + @target_pitch.to_s + link_char + @target_pitch.to_s end end class Glissando < TargetedLink - def initialize(target_pitch); super(target_pitch,"~"); end + def link_char; "~"; end end class Portamento < TargetedLink - def initialize(target_pitch); super(target_pitch,"/"); end + def link_char; "/"; end end class Slur < TargetedLink - def initialize(target_pitch); super(target_pitch,"="); end + def link_char; "="; end end class Legato < TargetedLink - def initialize(target_pitch); super(target_pitch,"-"); end + def link_char; "|"; end end end end end