Class: Music::Transcription::Link::TargetedLink
Instance Attribute Summary collapse
Instance Method Summary
collapse
#clone
Constructor Details
#initialize(target_pitch) ⇒ TargetedLink
Returns a new instance of TargetedLink.
35
36
37
|
# File 'lib/music-transcription/model/link.rb', line 35
def initialize target_pitch
@target_pitch = target_pitch
end
|
Instance Attribute Details
#target_pitch ⇒ Object
Returns the value of attribute target_pitch.
33
34
35
|
# File 'lib/music-transcription/model/link.rb', line 33
def target_pitch
@target_pitch
end
|
Instance Method Details
#==(other) ⇒ Object
39
40
41
|
# File 'lib/music-transcription/model/link.rb', line 39
def ==(other)
self.class == other.class && @target_pitch == other.target_pitch
end
|
#to_s ⇒ Object
52
53
54
|
# File 'lib/music-transcription/model/link.rb', line 52
def to_s
link_char + @target_pitch.to_s
end
|
#transpose(diff) ⇒ Object
43
44
45
|
# File 'lib/music-transcription/model/link.rb', line 43
def transpose diff
self.clone.transpose! diff
end
|
#transpose!(diff) ⇒ Object
47
48
49
50
|
# File 'lib/music-transcription/model/link.rb', line 47
def transpose! diff
@target_pitch = @target_pitch.transpose(diff)
return self
end
|