lib/music-transcription/model/link.rb in music-transcription-0.14.0 vs lib/music-transcription/model/link.rb in music-transcription-0.15.0
- old
+ new
@@ -16,12 +16,16 @@
def ==(other)
self.class == other.class
end
+ def transpose diff
+ self.clone.transpose! diff
+ end
+
def transpose! diff
- # do nothing, of course
+ return self
end
def to_s; "="; end
end
@@ -35,11 +39,15 @@
def ==(other)
self.class == other.class && @target_pitch == other.target_pitch
end
+ def transpose diff
+ self.clone.transpose! diff
+ end
+
def transpose! diff
- @target_pitch += diff
+ @target_pitch = @target_pitch.transpose(diff)
end
def to_s
@link_char + @target_pitch.to_s
end