lib/music-transcription/note.rb in music-transcription-0.9.2 vs lib/music-transcription/note.rb in music-transcription-0.10.0
- old
+ new
@@ -9,17 +9,16 @@
attr_reader :pitches, :links
attr_accessor :articulation, :duration, :accented
DEFAULT_ARTICULATION = Articulations::NORMAL
+ @@check_methods = [ :ensure_positive_duration ]
def initialize duration, pitches = [], articulation: DEFAULT_ARTICULATION, accented: false, links: {}
@duration = duration
@pitches = Set.new(pitches).sort
@articulation = articulation
@accented = accented
@links = links
-
- @check_methods = [ :ensure_positive_duration ]
end
def ensure_positive_duration
unless @duration > 0
raise NonPositiveError, "duration #{@duration} is not positive"