lib/tracksperanto/tracker.rb in tracksperanto-2.0.1 vs lib/tracksperanto/tracker.rb in tracksperanto-2.0.2
- old
+ new
@@ -1,27 +1,25 @@
# Internal representation of a tracker point with keyframes. A Tracker is an array of Keyframe objects and should act and work like one
class Tracksperanto::Tracker < DelegateClass(Array)
include Tracksperanto::Casts
+ include Tracksperanto::BlockInit
include Comparable
# Contains the name of the tracker
attr_accessor :name
cast_to_string :name
def initialize(object_attribute_hash = {})
@name = "Tracker"
__setobj__(Array.new)
- object_attribute_hash.map { |(k, v)| send("#{k}=", v) }
- yield(self) if block_given?
+ super
end
def keyframes=(new_kf_array)
__setobj__(new_kf_array.dup)
end
-
- def keyframes
- __getobj__
- end
+
+ alias_method :keyframes, :__getobj__
# Trackers sort by the position of the first keyframe
def <=>(other_tracker)
self[0].frame <=> other_tracker[0].frame
end
\ No newline at end of file